I have a deploy process that runs the migration then rolls out the new app version to our codebase. As a result, there is a period of time where the old version of the model is querying the database after the migration deleting the column has been run. This leads to errors like the following whenever the model with the removed column is read from the DB in the older version of the code:
column TABLE_NAME.COLUMN_NAME does not exist
LINE 1: ...
I think this medium post describes part of a potential solution. I think the solution would involve extending the migration logic to add some kind of noop that allows us to remove the column from the model in the app before removing in the migration, while tricking makemigrations into thinking that everything is in a legal state.
I have a deploy process that runs the migration then rolls out the new app version to our codebase. As a result, there is a period of time where the old version of the model is querying the database after the migration deleting the column has been run. This leads to errors like the following whenever the model with the removed column is read from the DB in the older version of the code:
I think this medium post describes part of a potential solution. I think the solution would involve extending the migration logic to add some kind of noop that allows us to remove the column from the model in the app before removing in the migration, while tricking
makemigrations
into thinking that everything is in a legal state.