Skip to content

Instantly share code, notes, and snippets.

@featherart
Last active February 5, 2020 06:29
Show Gist options
  • Save featherart/291cf3acaa96cdfd76242dabb0c5e051 to your computer and use it in GitHub Desktop.
Save featherart/291cf3acaa96cdfd76242dabb0c5e051 to your computer and use it in GitHub Desktop.
# generate context & controller for a JSON resource
# this will create a migration that when run will create a table for items
# this table has a description, a priority level and a flag for whether the task is complete
mix phx.gen.json TodoItem Item items description:string priority:integer is_complete:boolean
# to run the migration we will use ecto again
mix ecto.migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment