Skip to Content
Phoenix Web Development
book

Phoenix Web Development

by Brandon Richey
April 2018
Beginner to intermediate content levelBeginner to intermediate
406 pages
9h 33m
English
Packt Publishing
Content preview from Phoenix Web Development

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Phoenix in Action

Phoenix in Action

Geoffrey Lessel
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781787284197Supplemental Content