From: Jeremy Benoist Date: Tue, 22 Nov 2016 19:54:00 +0000 (+0100) Subject: Add migration for new FOSUser version X-Git-Tag: 2.2.0~3^2~46^2~1 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=be2725db406310ca3e025f1d0d79f768804245a2;p=github%2Fwallabag%2Fwallabag.git Add migration for new FOSUser version --- 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'); + } +}