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

Creating our Option schema

We'll need to create an Option schema, just like we have the Poll schema, but we'll need to do some additional legwork to make sure our representation makes sense. We'll also need to go back and fix up one thing we omitted from our Poll schema! First, we want to name our module Vocial.Votes.Option instead of Vocial.Votes.Poll (for obvious reasons). Next, we'll need to alias both Vocial.Votes.Poll and Vocial.Votes.Option. This is because we need the sanity helper for referencing the struct of our Option schema, and also because we'll need to reference the Poll schema as well to define our relationship to that table. We'll also need to create a :votes column on the schema; this one should be an integer with a default ...

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