X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=app%2FDoctrineMigrations%2FVersion20161128084725.php;fp=app%2FDoctrineMigrations%2FVersion20161128084725.php;h=347a4256b3781242b35fd9609fc6d488f0bc1294;hb=9f01d0fde09fa055a7db9f26e77c5e6b3d6c2224;hp=0000000000000000000000000000000000000000;hpb=34ea7be6228c633ef8da703994eed034026e9c18;p=github%2Fwallabag%2Fwallabag.git diff --git a/app/DoctrineMigrations/Version20161128084725.php b/app/DoctrineMigrations/Version20161128084725.php new file mode 100644 index 00000000..347a4256 --- /dev/null +++ b/app/DoctrineMigrations/Version20161128084725.php @@ -0,0 +1,49 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $configTable = $schema->getTable($this->getTable('config')); + $this->skipIf($configTable->hasColumn('view_mode'), 'It seems that you already played this migration.'); + + $configTable->addColumn('view_mode', 'integer'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $configTable = $schema->getTable($this->getTable('config')); + $configTable->dropColumn('view_mode'); + } +}