4 ms·
I keep telling Rubyists how much greater Alembic is than ActiveRecord::Migration. If there's a side by side comparison that would be great to know about!
by zeckalpha 11y ago
I keep telling Rubyists how much greater Alembic is than ActiveRecord::Migration. If there's a side by side comparison that would be great to know about!
- vinceguidry 11y agoBut then you'd have to use Python?
- aidos 11y agoGet to use Python :) (joking, obvs) It's always interesting to rummage cross platform to look at libraries so you can steal the good bits. SQLAlchemy has its roots in Hibernate for example. I'm also a very happy user of Alembic. I change my models as required and then use autogenerate to create the migration scripts. Then I tweak to account for slightly more esoteric things and data migrations. I find that it gets me 80% of the way there without having to think too much about the data model changes while I'm doing the initial development.
- stevepike 11y agoI'm a happy user of ActiveRecord::Migration, so I'd love to read that comparison. What do you keep telling the rubyists :)?
- zeckalpha 11y agoIt forces you to resolve conflicts. Two developers create a migration on the same day, but they get merged later. Alembic stops you and ask which goes first. ActiveRecord::Migration runs them both. This is particularly bad when one migration is a table drop and another is an add_column on the same table. And that's just one short coming. Our monkey patched ActiveRecord::Migration doesn't do this (yet), but we've done quite a few other improvements to it. Another significant difference is the migration generation. Once you've generated migrations with alembic, it's hard to tolerate anything else.