steder / goose

Simple configuration driven SQL migration tool
MIT License
3 stars 0 forks source link

Structuring Migrations (Removing Monolithic Migrations) #8

Open steder opened 12 years ago

steder commented 12 years ago

I'm kicking around some ideas for a more structured approach to migrations. Something between modeling ORM Entity changes to dynamically build migrations and the current state of Goose which is just a migration is just any SQL. Currently all migrations can change anything they want in any order. In some cases this can cause problems that require developers to maybe split common changes into another migration script or reorder some migrations to deal with dependencies.

I thinking that an approach that helps organize and order SQL migrations could offer some benefits.

For example, by separating SQL by type (stored proc, table, view, etc) or by affected table you could:

Basically by making the unit of work smaller and more structured we can make it potentially much easier to read the migrations as they'll be nicely categorized by type / table but you'll also be able to make the tool smarter and capable of merging work from many developers.