3 ms·
There are a lot of advantages to using a DSL for migration files rather than pure sql. For one, many times you will get both forward and reverse migration abili
by cortesoft 1y ago
There are a lot of advantages to using a DSL for migration files rather than pure sql. For one, many times you will get both forward and reverse migration ability automatically, to allow rollbacks (with the ability to mark certain migrations as unable to rollback). You also can have the DSL utilize different features depending on which database you are using without having to change your migration. You can also use special syntax to designate relations between tables easily without having to write the boilerplate SQL every time.
If you are using an ORM, using the same language and mental model to describe your database structure as you do to interact with the database makes a lot of sense.