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 Options table migration

Hooray! We've created our migrations, and run them successfully! Now, we have our representation of the first table in our models. We’ll continue on with creating another migration for our Options since our data model will be woefully incomplete without it! Let's begin:

$ mix ecto.gen.migration add_options_table* creating priv/repo/migrations* creating priv/repo/migrations/20171005185040_add_options_table.exs

If we open up the file, we’ll see the same skeleton we started within our last file. The new things we'll be using here are default values, and references as well! If you remember the design of our Options table, we have a title (which is a string), the votes (which is an integer counter of the number ...

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