April 2018
Beginner to intermediate
406 pages
9h 33m
English
If we look back to our planned design for the uploads table, we came up with the following criteria for what we figured we'd need: We'll need a table to store the URL or path, the poll ID, the user ID, the alt text, and a caption. Let's create our migration and do all of the work the hard way so that we can reinforce all of these concepts and continue to learn how to build an Elixir and Phoenix app at a deep level! We'll start by generating the migration and then editing that generated file:
$ mix ecto.gen.migration create_images_table* creating priv/repo/migrations* creating priv/repo/migrations/20171117232649_create_images_table.exs
Then, we open up the migration file:
defmodule Vocial.Repo.Migrations.CreateImagesTable ...