-
Notifications
You must be signed in to change notification settings - Fork 112
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
Allow to migrate all migrations with one "mark_migrated" call #125
Conversation
a6a37e7
to
80c003f
Compare
Seems like tests are failing |
But is |
@lorenzo Yes, that is expected, see last paragraph of my initial post. @dereuromark The problem is that with Either way, I'll take another look to see what I can do with that |
@dereuromark I took a look at that [
(int) 0 => '/vagrant/app31/bin/cake.php',
(int) 1 => 'migrations',
(int) 2 => 'mark_migrated',
(int) 3 => 'bin',
(int) 4 => 'composer.json',
(int) 5 => 'composer.lock',
(int) 6 => 'config',
(int) 7 => 'index.php',
(int) 8 => 'logs',
(int) 9 => 'phpunit.xml.dist',
(int) 10 => 'plugins',
(int) 11 => 'README.md',
(int) 12 => 'src',
(int) 13 => 'tests',
(int) 14 => 'tmp',
(int) 15 => 'vendor',
(int) 16 => 'webroot'
] So there is nothing I can do on that side. |
I agree, we can catch it to prevent the error but we should stick to the documentation for the intended all. |
@dereuromark Done. We just need to wait for the PR that will fix the tests for be merged on phinx. If it takes too long I'll try to do something on our side as a temporary fix. |
Added a special value "all" for the "version" argument of the "mark_migrated" command. It allows to mark all migrations found (based on the other arguments) as migrated in one call. Everything is done in one transaction. If one the marking as migrated operations raises an exception, the entire process is cancelled and the transaction rollbacked.
6bbf03a
to
7f1b25b
Compare
Branch rebased and CS fixed |
Allow to migrate all migrations with one "mark_migrated" call
👏 |
Added a special value
all
for theversion
argument of themark_migrated
command.It allows to mark all migrations found (based on the other arguments) as migrated in one call.
Everything is done in one transaction. If one the marking as migrated operations raises an exception, the entire process is cancelled and the transaction rollbacked.
I went with
all
instead of*
because the*
raised aTooManyArguments
exception (I could figured out why though).And
all
is closer to what we have in bake for instance.The tests will fail because I'm waiting for cakephp/phinx#641 to be reviewed, tested and merged (to be able to merge #123 after the build passes).
Refs #124