Added hardcoded SQL for migration to 2.2

This commit is contained in:
Nicolas Lœuillet
2017-01-23 14:16:00 +01:00
parent b87f171233
commit 4acbeb9371
7 changed files with 840 additions and 17 deletions

View File

@ -54,7 +54,10 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI
public function down(Schema $schema)
{
$userTable = $schema->getTable($this->getTable('user'));
$userTable->addColumn('expired', 'smallint');
$userTable->addColumn('credentials_expired', 'smallint');
$this->skipIf(true === $userTable->hasColumn('expired') || true === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.');
$userTable->addColumn('expired', 'smallint', ['notnull' => false]);
$userTable->addColumn('credentials_expired', 'smallint', ['notnull' => false]);
}
}