#14543: Adjusted implementation of migration name length limit

This commit is contained in:
Carsten Brandt
2017-10-26 23:20:37 +02:00
committed by Alexander Makarov
parent 336404e0b9
commit e311001ef5
4 changed files with 65 additions and 17 deletions

View File

@ -150,7 +150,23 @@ class MigrateControllerTest extends TestCase
$result = $this->runMigrateControllerAction('up');
$this->assertContains('The migration name is too long. The rest of the migrations are canceled.', $result);
$this->assertContains('The migration name', $result);
$this->assertContains('is too long. Its not possible to apply this migration.', $result);
}
public function testNamedMigrationWithCustomLimit()
{
Yii::$app->db->createCommand()->createTable('migration', [
'version' => 'varchar(255) NOT NULL PRIMARY KEY', // varchar(255) is longer than the default of 180
'apply_time' => 'integer',
])->execute();
$this->createMigration(str_repeat('a', 180));
$result = $this->runMigrateControllerAction('up');
$this->assertContains('1 migration was applied.', $result);
$this->assertContains('Migrated up successfully.', $result);
}
public function testCreateLongNamedMigration()