4 ms·
You can do straight SQL in migrations, and when I'm working with PostgreSQL I usually do. I don't really see the need or desirability to fully abstract SQL away
by jlangenauer 17y ago
You can do straight SQL in migrations, and when I'm working with PostgreSQL I usually do. I don't really see the need or desirability to fully abstract SQL away in Ruby: either you'll have to avoid using some of the features of SQL, or you'll create a DSL to describe SQL which will end up being more verbose than SQL is anyway.
Personally, I use Rails migrations as a versioning system for my DB schema, but within the migrations itself, it's just a straight "execute" call with the SQL to create, alter, or drop the tables as required.