<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20211125192113 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE plan_service (plan_id INT NOT NULL, service_id INT NOT NULL, INDEX IDX_5F22D2DAE899029B (plan_id), INDEX IDX_5F22D2DAED5CA9E6 (service_id), PRIMARY KEY(plan_id, service_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE service (id INT AUTO_INCREMENT NOT NULL, service VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE plan_service ADD CONSTRAINT FK_5F22D2DAE899029B FOREIGN KEY (plan_id) REFERENCES plan (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE plan_service ADD CONSTRAINT FK_5F22D2DAED5CA9E6 FOREIGN KEY (service_id) REFERENCES service (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE exposed_sub_domain ADD created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', ADD updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE plan_service DROP FOREIGN KEY FK_5F22D2DAED5CA9E6');
$this->addSql('DROP TABLE plan_service');
$this->addSql('DROP TABLE service');
$this->addSql('ALTER TABLE exposed_sub_domain DROP created_at, DROP updated_at');
}
}