|
|
|
|
|
by exekias
991 days ago
|
|
For migrations altering columns (for instance adding a constraint), data gets upgraded/downgraded between old and new versions trough the up/down functions. These are defined by the migration. They work like this: - For rows inserted/updated through the old version of the schema, the up function gets executed, copying the resulting value into the new column
- For rows inserted/updated through the new version, the down function gets executed, copying the resulting value into the old column For instance, you can test that up function works before releasing the new app relying on it, just by checking that the values present in the new schema are correct. |
|