$this->container = $container;
}
- private function getTable($tableName)
- {
- return $this->container->getParameter('database_table_prefix').$tableName;
- }
-
/**
* @param Schema $schema
*/
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]);
+ }
+
+ private function getTable($tableName)
+ {
+ return $this->container->getParameter('database_table_prefix') . $tableName;
}
}