From 10b3509757c704943aa9cdd69c1d02bedfa937a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 18 Nov 2016 15:09:21 +0100 Subject: Added http_status in Entry entity --- app/DoctrineMigrations/Version20161118134328.php | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161118134328.php (limited to 'app/DoctrineMigrations') diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php new file mode 100644 index 00000000..b5413ddc --- /dev/null +++ b/app/DoctrineMigrations/Version20161118134328.php @@ -0,0 +1,47 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD http_status INT DEFAULT 0'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + + $this->addSql('ALTER TABLE '.$this->getTable('entry').' DROP http_status'); + } +} -- cgit v1.2.3