4 ms·
There's a useful gem that creates a data_migrations directory (and associated table once run) for things like this, that are not changing the schema. I tend to
by jaggederest 4y ago
There's a useful gem that creates a data_migrations directory (and associated table once run) for things like this, that are not changing the schema. I tend to write them as rake tasks with an `up` and `down` method if they are reversible. Also, hopefully, the migrations are idempotent and just do nothing if there are no affected records (though not all data changes are like that of course)
- chao- 4y ago>There's a useful gem that creates a data_migrations directory Would you please share this useful gem's name? I have hand-rolled some variety of this solution so many times that it feels like just a part of life, like doing the laundry. If a gem can do that setup for me, I would gladly use it.
- mrcb123 4y agohttps://github.com/ilyakatz/data-migrate https://github.com/ilyakatz/data-migrate and for seeding data https://github.com/pboling/seed_migration https://github.com/pboling/seed_migration
- jaggederest 4y agoI was thinking of this one, I believe, but it's pretty old: https://github.com/OffgridElectric/rails-data-migrations https://github.com/OffgridElectric/rails-data-migrations This is maybe a more modern one I found: https://github.com/ilyakatz/data-migrate https://github.com/ilyakatz/data-migrate