From dda6a6addc0fd54031514e81d2b55d5066b7157c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 11 May 2017 14:18:21 +0200 Subject: Added headers field in Entry --- app/DoctrineMigrations/Version20170511115400.php | 55 ++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 app/DoctrineMigrations/Version20170511115400.php (limited to 'app/DoctrineMigrations/Version20170511115400.php') diff --git a/app/DoctrineMigrations/Version20170511115400.php b/app/DoctrineMigrations/Version20170511115400.php new file mode 100644 index 00000000..64ee9e0a --- /dev/null +++ b/app/DoctrineMigrations/Version20170511115400.php @@ -0,0 +1,55 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $entryTable = $schema->getTable($this->getTable('entry')); + + $this->skipIf($entryTable->hasColumn('headers'), 'It seems that you already played this migration.'); + + $entryTable->addColumn('headers', 'text', [ + 'notnull' => false, + ]); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $entryTable = $schema->getTable($this->getTable('entry')); + + $this->skipIf(!$entryTable->hasColumn('headers'), 'It seems that you already played this migration.'); + + $entryTable->dropColumn('headers'); + } +} -- cgit v1.2.3 From f808b01692a835673f328d7221ba8c212caa9b61 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 1 Jul 2017 09:52:38 +0200 Subject: Add a real configuration for CS-Fixer --- app/DoctrineMigrations/Version20170511115400.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/DoctrineMigrations/Version20170511115400.php') diff --git a/app/DoctrineMigrations/Version20170511115400.php b/app/DoctrineMigrations/Version20170511115400.php index 64ee9e0a..cad2b637 100644 --- a/app/DoctrineMigrations/Version20170511115400.php +++ b/app/DoctrineMigrations/Version20170511115400.php @@ -22,11 +22,6 @@ class Version20170511115400 extends AbstractMigration implements ContainerAwareI $this->container = $container; } - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix').$tableName; - } - /** * @param Schema $schema */ @@ -52,4 +47,9 @@ class Version20170511115400 extends AbstractMigration implements ContainerAwareI $entryTable->dropColumn('headers'); } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } } -- cgit v1.2.3