<?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 Version20220310100439 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 choice_en (id INT AUTO_INCREMENT NOT NULL, question_id INT NOT NULL, text LONGTEXT NOT NULL, number VARCHAR(40) NOT NULL, INDEX IDX_D5E6C0C31E27F6BF (question_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE question_en (id INT AUTO_INCREMENT NOT NULL, serie_id INT DEFAULT NULL, content VARCHAR(255) NOT NULL, help LONGTEXT DEFAULT NULL, name VARCHAR(40) NOT NULL, type VARCHAR(40) DEFAULT NULL, INDEX IDX_524750ADD94388BD (serie_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE serie_en (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(40) NOT NULL, title LONGTEXT NOT NULL, help LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE step_en (id INT AUTO_INCREMENT NOT NULL, serie_id INT NOT NULL, description LONGTEXT NOT NULL, help LONGTEXT DEFAULT NULL, number INT NOT NULL, type VARCHAR(255) NOT NULL, progress VARCHAR(255) DEFAULT NULL, INDEX IDX_3FD2B88ED94388BD (serie_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE choice_en ADD CONSTRAINT FK_D5E6C0C31E27F6BF FOREIGN KEY (question_id) REFERENCES question_en (id)');
$this->addSql('ALTER TABLE question_en ADD CONSTRAINT FK_524750ADD94388BD FOREIGN KEY (serie_id) REFERENCES serie_en (id)');
$this->addSql('ALTER TABLE step_en ADD CONSTRAINT FK_3FD2B88ED94388BD FOREIGN KEY (serie_id) REFERENCES serie_en (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE choice_en DROP FOREIGN KEY FK_D5E6C0C31E27F6BF');
$this->addSql('ALTER TABLE question_en DROP FOREIGN KEY FK_524750ADD94388BD');
$this->addSql('ALTER TABLE step_en DROP FOREIGN KEY FK_3FD2B88ED94388BD');
$this->addSql('DROP TABLE choice_en');
$this->addSql('DROP TABLE question_en');
$this->addSql('DROP TABLE serie_en');
$this->addSql('DROP TABLE step_en');
$this->addSql('ALTER TABLE answers CHANGE flow flow LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE choice CHANGE text text LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE number number VARCHAR(40) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE logs CHANGE first_time first_time VARCHAR(127) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE finish finish VARCHAR(127) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE connexion_ip connexion_ip VARCHAR(1023) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE deconnexion deconnexion VARCHAR(1023) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE mail CHANGE code code VARCHAR(16) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE adresses adresses VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE question CHANGE content content VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE help help LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE name name VARCHAR(40) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE type type VARCHAR(40) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE serie CHANGE name name VARCHAR(40) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE title title LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE help help LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE step CHANGE description description LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE help help LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE type type VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE progress progress VARCHAR(255) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE user CHANGE username username VARCHAR(180) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE roles roles LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:json)\', CHANGE password password VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE ip_address ip_address VARCHAR(400) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE creation_date creation_date VARCHAR(400) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE last_login last_login VARCHAR(400) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE infos infos LONGTEXT DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE sexe sexe VARCHAR(1) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE last_action last_action VARCHAR(400) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
}
}