-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submodule migrations #9
Comments
I've kinda started something along these lines, my thoughts were that if you wanted a separate log for each migration sets, you'd have to provide phpmig with an adapter and an array of migrations for each set: <?php
$container['phpmig.sets']['cms'] = array(
'adapter' => new Phpmig_Adapter_Flat_File(__DIR__ . '/modules/cms/migrations/.migrations.log'),
'migrations' => glob(__DIR__ . '/modules/cms/migrations/*.php'),
); That way, each database can have their own migrations table etc. If you're not bothered about having separate logging, I'd just use the globbing e.g. glob(DIR . '/modules//migrations/.php'). In the unlikely event you have a name clash, I'd just change the timestamp on one of the migrations |
[deleted] |
@reenl was that meant for a different issue? |
Sorry see #45 |
how do you setup that phpmig.sets item, I keep getting Identifier "phpmig.sets" is not defined. when I do it the way described on this post. |
seems to be a bug, I forked your code and looking to fix it |
This is more of a feature idea.
My projects are made up of a bunch of modules. It would be good if each module could keep its own migrations, but run them as part of an application.
For example I have this directory structure:
Running phpmig on the project directory should run all migrations, including ones in sub modules.
There would be of course problems with the current logging format and DI containers. The logging of migrations that have been run would need to be stored in the project log file/DB. And each sub module would have to have a compatible DI object for accessing the database.
The log file (I haven't used DB logging) could be adapted like so:
I'm happy to implement this, what are you thoughts?
The text was updated successfully, but these errors were encountered: