In the entity relationship diagram (ERD) below, we show a schema for messages using emails as an example. The ERD shows expected model columns and their relationships, with necessary primary (PK) and foreign keys (FK).
In the ERD above, Users are connected to different Events -- such as email opens and clicks -- through a unique user_id. Events require a timestamp. They can have additional columns based on the Event type, such as a clicked_url for email click events.
Each Event is also linked to an Asset model, either email or SMS, by way of a message_id. The message can have a variety of columns, including date columns such as start_at and ended_at to indicate the dates that email asset was in use.
Ready to get started?
Jump right in or a book a demo. Your first destination is always free.