Reference a migration from other
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the migration A and migration Z scenario in the issue, then review how the up and down methods currently run. Determine whether a down migration can safely reference another migration's up or change operation, including the stated limitation around later schema changes. Done means the behavior, limitations, and documentation expectations are defined clearly enough to implement and test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100