DB schema_migration table used to know which migrations have yet to run
Usage
mix ecto.gen.migration [action_name]
Edit in priv/repo/migrations
defmoduleReactPhoenix.Repo.Migrations.ChangeGiddouseEcto.Migrationdefchangedo alter table(:users) do add :address, :string add :usertype_id,references(:usertypes, on_delete: :nothing) add :event_id,references(:usertypes, on_delete: :delete_all, type: :string) add :my_array, {:array, inner_type} modify :title, :text remove :viewsend#rename is outside alter statement rename table(:subevents), :parent, to: :event_id#order matters, if another column depends should remove before dropping drop table(:registration_question_options)endend
:nothing - if any referencing rows still exist when the constraint is checked, an error is raised; this is the default behavior if you do not specify anything.
:delete_all - specifies that when a referenced row is deleted, row(s) referencing it should be automatically deleted as well
:nilify_all - causes the referencing column(s) in the referencing row(s) to be set to nil when the referenced row is deleted
:restrict - prevents deletion of a referenced row. It will fail if there is a referenced object.