phinx
phinx copied to clipboard
Migrate using target throws warning
When I am migrating using --target 2012
, I get a warning
warning 2012 is not a valid version
However, will work if I use the full date/time, eg --date 2012010308
.
Use --date
with partial dates, use --target
with complete version.
http://docs.phinx.org/en/latest/commands.html#the-rollback-command
This is not for the rollback
command... this is for the migrate
command.
If I do a phinx migrate --help
, I get the following:
Help:
The migrate command runs all available migrations, optionally up to a specific version
phinx migrate -e development
phinx migrate -e development -t 20110103081132
phinx migrate -e development -d 20110103
phinx migrate -e development -v
And when I do a phinx migrate -d 2002
:
Migrating to version 20030201010101
== 20020001010000 UserMigration: migrating
== 20020001010000 UserMigration: migrated 0.0477s
== 20030101010000 ProductMigration: migrating
== 20030101010000 ProductMigration: migrated 0.0438s
== 20030201010101 OrderMigration: migrating
== 20030201010101 OrderMigration: migrated 0.0448s
Both migrate
and rollback
has both options and should work same way.
I've compared how --date
is handled:
-
rollback
appends0101000000
to 2012 to have full version; -
migrate
will just try to donew \DateTime('2012')
, which fails.
Need to update to behave same.
Watch out for the behaviour of version_order when set 'execution'.
This could account for the differences you think you may be seeing.