I've created a simple user model using phoenix.gen.html
with the schema produced in models/user.ex
as follows.
schema "users" do
field :name, :string
field :email, :string
field :bio, :string
field :dislikes_turnips, :boolean
timestamps
end
Along with models/user.ex
, the database table has been created along with the views, controllers and templates.
I'd like to update my User Model by changing one field and adding another to the create something like the following.
schema "users" do
field :name, :string
field :email, :string
field :bio, :string
field :likes_turnips, :boolean
field :turnips, :integer
timestamps
end
Is there a mix task or similar to update the related database table, views, controllers and templates in one go?
And if not, what would be the recommended process to change/update these files?