|
|
|
|
|
by fabianlindfors
1830 days ago
|
|
With this model, migrations would be two-stepped. First the migration would be applied, creating a new schema and adding the new information to the underlying table. Once the version is old and no longer used by any clients, the migration would be "deleted", removing the schema and the underlying information. So when dropping a column it would go like this:
1. Migration is applied. Columns is removed from the new view but remains in the backing table.
2. Migration is no longer needed. Column is removed from backing table. This design should be extendable to cover changing data type (introduce a new column and moves values over + sync values using trigger), changing default or changing the contents of a full column. Constraints or indices are a bit trickier, but it might work to create a new column duplicated from the old one and add constraints to that instead. |
|