9 ms·
> I'm really not sure what advantage the schema DSL in schema.rb has over the ability to express the full schema in its native tongue. I always end up using t
by ikawe 12y ago
> I'm really not sure what advantage the schema DSL in schema.rb has over the ability to express the full schema in its native tongue.
I always end up using the sql format, because sooner or later I do something remotely non-trivial in postgres. But I'll try to answer your implicit question...
schema.rb works just fine for sufficiently simple schema, it's easier to make sense of in version control, and it's backend agnostic, so if someone wants to develop the app on sqlite - that's just fine.
Of course, all these things become a downside when your setup is sufficiently complex - but if you are not using any interesting database features it's fine. In particular, I would almost never recommend developing against a different DB than you are deploying on. Sooner or later you'll be bit by a behavioral difference.