From be2725db406310ca3e025f1d0d79f768804245a2 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 22 Nov 2016 20:54:00 +0100 Subject: [PATCH] Add migration for new FOSUser version --- .../Version20161122203647.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161122203647.php diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php new file mode 100644 index 00000000..ea2703b6 --- /dev/null +++ b/app/DoctrineMigrations/Version20161122203647.php @@ -0,0 +1,57 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + + $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP expired'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP credentials_expired'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD expired tinyint(1) NULL DEFAULT 0'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD credentials_expired tinyint(1) NULL DEFAULT 0'); + } +} -- 2.41.0