phinx
phinx copied to clipboard
Reference a migration from other
Use case:
Migration A: xxxxx_create_table_orders.php
Many migrations and months later
Migration Z: xxxxx_drop_table_orders.php
To make migration Z reversible, I need to implement up
and down
methods.
The up
have a drop()
call, so, on down
I need a create()
counterpart, with all my schema.
Suggestion
If we have one method to call from down
witch run the migration A::up (or change) would be great. Something like:
public function down() {
$this->use('create_table_orders');
}
I know there are limitations: if you have changed anything into table between the two migrations, that will be loose. But I think that can be advertised on docs.
Do you want to make a PR for it?