<?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 Version20180327103336 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('CREATE TABLE membership_status_history (`id` INT AUTO_INCREMENT NOT NULL, `status` VARCHAR(255) NOT NULL COMMENT \'(DC2Type:membership_status)\', `date` DATETIME NOT NULL, `month` INT DEFAULT NULL, `membership_id` INT NOT NULL, INDEX IDX_7911B2053E2CBC4F (`membership_id`), PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE membership_status_history ADD CONSTRAINT FK_7911B2053E2CBC4F FOREIGN KEY (`membership_id`) REFERENCES membership (`id`)');
}
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('DROP TABLE membership_status_history');
}
}