Rollback doesn't remove tables created via `change()`
Open
Nobody has claimed this yet.
docs
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
Just wasted half-hour because of this bug. The title is quite self-explanatory.
Make some migration which creates a table:
<?php
use Phinx\Migration\AbstractMigration;
class CreateTestTable extends AbstractMigration
{
public function change()
{
$this->table('test')
->addColumn('name', 'string')
->save();
}
}
Then do migrate and rollback. At rollback it will simply delete all columns but id and keep the table.
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 by reproducing the migration shown in AbstractMigration::change(), using table('test')->addColumn(...)->save(), then run migrate followed by rollback. Trace how the change() operation handles the table during rollback. Done means the rollback removes the test table rather than leaving an empty table with only its id column.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100