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 interactions -- such as email opens and clicks -- through a unique user_id. Interactions are events, and so require a timestamp. They can have additional columns based on the type of interaction, such as a clicked_url for email click events.
Each interaction is also linked to a message asset, 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.