-
Notifications
You must be signed in to change notification settings - Fork 9
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
Running only a single migration? #20
Comments
@mxstbr It is still not possible to run a single migration by name. I'll add this issue to 1.1 milestone for now, but I think this could cause some problems when a migration depends on some previously run migration. |
The ability to run migrations to would satisfy my needs.
|
but what does 'seed' and 'staging' mean? migrations are just files in a directory, there is no other metadata associated with them. |
@jmodjeski so seed and staging are just examples of migration files, right? |
Looking at Laravel, we might follow their lead and use a A quick glance at the source code makes me think all that's needed is to:
From my perspective having the default behavior of down be to rollback all migrations is a bit nerve racking (visions of someone accidentally running it on production and dropping all their tables). I'd frankly prefer there be a confirmation prompt, "Do you really want to rollback all migrations?" or a --force required. But: just my $0.02. |
Hey @gristow, I agree that having the default behavior as rolling back all migrations is not ideal. I think the default behavior, not only for the Laravel migration API you cited but for other migration tools is to batch migrations for rollback, so if you created 2 new migrations and then migrated up those two in a single migrate up operation, when you roll back changes those two migrations would be undone. I think this should be target behavior if we are to change how rollback is done, but that would require more changes that what you proposed. The @lirantal what do you think? I can start working on this, which would require a major release, but I don't have much time available to work on this, so it might not get done too soon. Of course, PRs are accepted and appreciated. |
I can certainly do a PR for implementing |
Agree with @gristow about the default not being rolling back everything as that can lead to disastrous state and instead requiring an actual In general, there are two requirements in this issue:
@gristow let the PR party begin ;-) |
Great, PR for For symmetry, should I add |
definitely, thanks! |
v1.4.0 released with --step support. Thanks to @gristow! |
Maybe this is already possible, just not documented, but it'd be awesome to be able to run a single migration based on the name it was created as:
Even better if that had glob support:
The text was updated successfully, but these errors were encountered: