Specify Up and Down Operations
Learn how to use up and down operations.
We'll cover the following...
In the last section, we created a migration that altered data and structure, but we left out an important step. In its current form, this migration can’t be rolled back.
Ecto can’t reverse the removal of a column because it wouldn’t know what type it should be restored back to. We certainly can’t expect Ecto to figure out how to reverse the data transformation we did between compositions
and compositions_artists
. We need to ...