<?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 Version20220708102536 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 domain_order (id INT AUTO_INCREMENT NOT NULL, training_id INT DEFAULT NULL, domain_id INT DEFAULT NULL, type_id INT DEFAULT NULL, order_training INT NOT NULL, INDEX IDX_2652BB4EBEFD98D1 (training_id), INDEX IDX_2652BB4E115F0EE5 (domain_id), INDEX IDX_2652BB4EC54C8C93 (type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL, available_at DATETIME NOT NULL, delivered_at DATETIME DEFAULT NULL, INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE domain_order ADD CONSTRAINT FK_2652BB4EBEFD98D1 FOREIGN KEY (training_id) REFERENCES trainings (id)');
$this->addSql('ALTER TABLE domain_order ADD CONSTRAINT FK_2652BB4E115F0EE5 FOREIGN KEY (domain_id) REFERENCES domain (id)');
$this->addSql('ALTER TABLE domain_order ADD CONSTRAINT FK_2652BB4EC54C8C93 FOREIGN KEY (type_id) REFERENCES type (id)');
$this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE domain_order');
$this->addSql('DROP TABLE messenger_messages');
$this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
}
}