From 7d4f865f10e444cdd88cfe7134ffb6a05da7fc28 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Sat, 4 Jul 2015 21:23:19 +0200 Subject: [PATCH] remark & attendee can be null --- .../migrations/Version20150704091347.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Resources/migrations/Version20150704091347.php diff --git a/Resources/migrations/Version20150704091347.php b/Resources/migrations/Version20150704091347.php new file mode 100644 index 000000000..1f13f95ee --- /dev/null +++ b/Resources/migrations/Version20150704091347.php @@ -0,0 +1,57 @@ +, + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Application\Migrations; + +use Doctrine\DBAL\Migrations\AbstractMigration; +use Doctrine\DBAL\Schema\Schema; + +/** + * Db Migration + * + */ +class Version20150704091347 extends AbstractMigration +{ + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + // this up() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE Activity ALTER COLUMN remark DROP NOT NULL;'); + $this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE Activity ALTER COLUMN remark SET NOT NULL;'); + $this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;'); + } +}