Skip to content
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

Reference a migration from other #1638

Open
CauanCabral opened this issue Nov 1, 2019 · 1 comment
Open

Reference a migration from other #1638

CauanCabral opened this issue Nov 1, 2019 · 1 comment

Comments

@CauanCabral
Copy link

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.

@dereuromark
Copy link
Member

Do you want to make a PR for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants