[openstreetmap/openstreetmap-website] Models in migrations (#2320)
Andy Allan
notifications at github.com
Wed Jul 17 10:34:37 UTC 2019
> Oh come on, this is just insane.
No it's not, it's perfectly normal.
> Where exactly is this "best practice" advice coming from? Please don't tell me it's `strong_migrations`...
It's got nothing to do with strong migrations. See e.g. http://railsguides.net/change-data-in-migrations-like-a-boss/ https://github.com/rubocop-hq/rails-style-guide#define-model-class-migrations http://blog.testdouble.com/posts/2014-11-04-healthy-migration-habits.html and elsewhere.
This PR is exactly to decouple the old migrations from the current state of the models. We should never have been relying on the current models in the old migrations, right from the moment they were written. If we ever e.g. remove a model, or rename a table when an old migration depends on the model, etc et, then the migrations break.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2320#issuecomment-512199403
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190717/3650c50c/attachment.html>
More information about the rails-dev
mailing list