Working with the chat schema

From the previous mockups, we can pretty comfortably design out what the schema for our chat information should look like. We'll want to store enough information to be able to rebuild the display when a user goes to the page, as well as information related to who said what and when. We'll stick with that to start since it is the simplest implementation:

table: messages--------------------------  id : integer, primary key  message : string, not null  author : string, not null  poll_id : integer, references polls, nullable  inserted_at : timestamp  created_at : timestamp

We have the standard columns that are created as a part of every Ecto table (id, inserted_at, and created_at), so we'll skip those. The key fields in ...

Get Phoenix Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.