<?php declare (strict_types = 1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180328140159 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE membership_status_history DROP FOREIGN KEY FK_7911B2053E2CBC4F');
$this->addSql('ALTER TABLE membership_status_history ADD CONSTRAINT FK_7911B2053E2CBC4F FOREIGN KEY (`membership_id`) REFERENCES membership (`id`) ON DELETE CASCADE');
$this->addSql('ALTER TABLE membership_survey DROP start_date, DROP end_date');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE membership_status_history DROP FOREIGN KEY FK_7911B2053E2CBC4F');
$this->addSql('ALTER TABLE membership_status_history ADD CONSTRAINT FK_7911B2053E2CBC4F FOREIGN KEY (membership_id) REFERENCES membership (id)');
$this->addSql('ALTER TABLE membership_survey ADD start_date DATETIME DEFAULT NULL, ADD end_date DATETIME DEFAULT NULL');
}
}