X-Git-Url: https://git.immae.eu/?p=github%2Fwallabag%2Fwallabag.git;a=blobdiff_plain;f=app%2FDoctrineMigrations%2FVersion20170710113900.php;fp=app%2FDoctrineMigrations%2FVersion20170710113900.php;h=7be831100901acaad6382243d7fff5b51781aabe;hp=0000000000000000000000000000000000000000;hb=3b68f6ca727f52f9dc84fa1a134c092b44c49103;hpb=3f7a28de8473db53b3de9e19d5e8e58b4e21090d diff --git a/app/DoctrineMigrations/Version20170710113900.php b/app/DoctrineMigrations/Version20170710113900.php new file mode 100644 index 00000000..7be83110 --- /dev/null +++ b/app/DoctrineMigrations/Version20170710113900.php @@ -0,0 +1,54 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $usersTable = $schema->getTable($this->getTable('user')); + + $this->skipIf($usersTable->hasColumn('dn'), 'It seems that you already played this migration.'); + + $usersTable->addColumn('dn', 'text', [ + 'default' => null, + 'notnull' => false, + ]); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $usersTable = $schema->getTable($this->getTable('user')); + $usersTable->dropColumn('dn'); + } +} +