ruckus / ruckusing-migrations

Database migrations for PHP ala ActiveRecord Migrations with support for MySQL, Postgres, SQLite
Other
506 stars 95 forks source link

Categorize migrations by application version #144

Closed clphillips closed 10 years ago

clphillips commented 10 years ago

I'm considering organizing migrations into separate "modules" with names based on the application's semantic version number.

For example:

/migrations/
    1.0.0/
        /my_db_name/
            20141021000000_CreateAuthors.php
            20141022000000_CreateBooks.php
    1.1.0/
        /my_db_name/
            20141023000000_UpdateAuthors.php

I want to be able to run everything in the 1.0.0 and 1.1.0 "module" directories in one go. Would this have to be done with subsequent calls to ruckusing (one for each module)? Or could I override the default behavior through some interface?

I have to imagine someone has tried this before.

ruckus commented 10 years ago

Hi Cody - this is the first time such a request has come up. You're welcome to bang on it and submit a PR. But to be honest I think it would add a lot of complexity and it seems like a pretty unique use-case (?)

clphillips commented 10 years ago

I've come to the conclusion that while having subdirectories organize semantic versions is nice, it's not a necessity for me (with a little grunt magic, I can automatically track which migrations belong to which semantic versions in a config file).