You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't a bug in the code per se, but it's something that I think the documentation or detection logic could help with.
When you drop a column with a not-null constraint, strong_migrations tells you that you must first ignore the column in a separate deploy to ensure the database cache is cleaned out. No problem. This is also a nice soft way to be sure your application isn't depending on that column anymore.
However, if you have factories or fixtures and such set up in this situation, the DB will complain if they try to insert a record without that column. If you put the value back into the fixtures or factories, ActiveRecord will get mad at you for trying to set a value that is ignored. So if you have CI that should pass before you get this deploy done, you lose signal.
I'm not sure what should be done here. The simplest thing I can see is to have strong_migrations advise you to drop the NOT NULL constraint at the same time the column is ignored, but something about that seems messy.
The text was updated successfully, but these errors were encountered:
Hey @lake-effect, thanks for sharing. If there's no default value, I think allowing null for fixtures and factories makes sense. I'm on the fence about whether Strong Migrations should mention it (either in the readme and/or error message) - will leave this open for a bit to think about.
This isn't a bug in the code per se, but it's something that I think the documentation or detection logic could help with.
When you drop a column with a not-null constraint, strong_migrations tells you that you must first ignore the column in a separate deploy to ensure the database cache is cleaned out. No problem. This is also a nice soft way to be sure your application isn't depending on that column anymore.
However, if you have factories or fixtures and such set up in this situation, the DB will complain if they try to insert a record without that column. If you put the value back into the fixtures or factories, ActiveRecord will get mad at you for trying to set a value that is ignored. So if you have CI that should pass before you get this deploy done, you lose signal.
I'm not sure what should be done here. The simplest thing I can see is to have strong_migrations advise you to drop the NOT NULL constraint at the same time the column is ignored, but something about that seems messy.
The text was updated successfully, but these errors were encountered: