What does "Migration has pending actions after execution!" mean? The text of migrations follows below the error block.
$ vendor/bin/phinx migrate -e development
Phinx by CakePHP - https://phinx.org. 0.10.6
using config file .\phinx.yml
using config parser yaml
using migration paths
- C:\Users\xxxx\projects\v2.phinx\db\migrations
using seed paths
- C:\Users\xxxx\projects\v2.phinx\db\seeds
using environment development
using adapter mysql
using database recall_qa
== 20181010060206 DropUniqueConstraintEmailLog: migrating
In AbstractMigration.php line 362:
Migration has pending actions after execution!
migrate [-c|--configuration CONFIGURATION] [-p|--parser PARSER] [-e|--environment ENVIRONMENT] [-t|--target TARGET] [-d|--date DATE] [-x|--dry-run] [--fake]
{
/**
* Migrate Up.
*/
public function up()
{
$table = $this->table('email_log');
$table->removeIndexByName('idx_event_id_to_tag');
}
/**
* Migrate Down.
*/
public function down()
{
$table = $this->table('email_log');
$table->addIndex(['event_id', 'to', 'tag'], [
'unique' => true,
'name' => 'idx_event_id_to_tag'])
->save();
}
}
You didn't call $table->save(); in up().
public function change()
{
$this->table('email_log')
->addIndex(
['event_id', 'to', 'tag'],
[
'unique' => true,
'name' => 'idx_event_id_to_tag',
]
)
->update();
}
Is (I hope) an alternative to up()/down().
Documentation at http://docs.phinx.org/en/latest/migrations.html#working-with-indexes states:
There is no need to call the save() method when using removeIndex(). The index will be removed immediately.
Still looking for answers.
You need to call save() Docs are outdated
Most helpful comment
You didn't call
$table->save();inup().