<?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 Version20220327123937 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 bon_plan (id INT AUTO_INCREMENT NOT NULL, categorie_bon_plan_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', image VARCHAR(255) DEFAULT NULL, INDEX IDX_FEB1F6F2F17F8158 (categorie_bon_plan_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE categorie_bon_plan (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE priority_requete (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE requete (id INT AUTO_INCREMENT NOT NULL, type_requete_id INT DEFAULT NULL, priority_id INT DEFAULT NULL, status_id INT DEFAULT NULL, ticket VARCHAR(255) DEFAULT NULL, email VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_1E6639AA5F8826A (type_requete_id), INDEX IDX_1E6639AA497B19F9 (priority_id), INDEX IDX_1E6639AA6BF700BD (status_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE status_requete (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE type_requete (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE bon_plan ADD CONSTRAINT FK_FEB1F6F2F17F8158 FOREIGN KEY (categorie_bon_plan_id) REFERENCES categorie_bon_plan (id)');
$this->addSql('ALTER TABLE requete ADD CONSTRAINT FK_1E6639AA5F8826A FOREIGN KEY (type_requete_id) REFERENCES type_requete (id)');
$this->addSql('ALTER TABLE requete ADD CONSTRAINT FK_1E6639AA497B19F9 FOREIGN KEY (priority_id) REFERENCES priority_requete (id)');
$this->addSql('ALTER TABLE requete ADD CONSTRAINT FK_1E6639AA6BF700BD FOREIGN KEY (status_id) REFERENCES status_requete (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bon_plan DROP FOREIGN KEY FK_FEB1F6F2F17F8158');
$this->addSql('ALTER TABLE requete DROP FOREIGN KEY FK_1E6639AA497B19F9');
$this->addSql('ALTER TABLE requete DROP FOREIGN KEY FK_1E6639AA6BF700BD');
$this->addSql('ALTER TABLE requete DROP FOREIGN KEY FK_1E6639AA5F8826A');
$this->addSql('DROP TABLE bon_plan');
$this->addSql('DROP TABLE categorie_bon_plan');
$this->addSql('DROP TABLE priority_requete');
$this->addSql('DROP TABLE requete');
$this->addSql('DROP TABLE status_requete');
$this->addSql('DROP TABLE type_requete');
}
}