<?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 Version20210922134739 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 scenario_project_types (project_id INT NOT NULL, type_id INT NOT NULL, INDEX IDX_E72C3DE2166D1F9C (project_id), INDEX IDX_E72C3DE2C54C8C93 (type_id), PRIMARY KEY(project_id, type_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE scenario_project_types ADD CONSTRAINT FK_E72C3DE2166D1F9C FOREIGN KEY (project_id) REFERENCES scenario_project (id)');
$this->addSql('ALTER TABLE scenario_project_types ADD CONSTRAINT FK_E72C3DE2C54C8C93 FOREIGN KEY (type_id) REFERENCES scenario_type (id)');
$this->addSql('ALTER TABLE chat_message DROP name');
$this->addSql('ALTER TABLE scenario DROP FOREIGN KEY FK_3E45C8D8166D1F9C');
$this->addSql('DROP INDEX IDX_3E45C8D8166D1F9C ON scenario');
$this->addSql('ALTER TABLE scenario ADD status VARCHAR(50) NOT NULL, ADD assigned_at1 DATETIME DEFAULT NULL, ADD assigned_at2 DATETIME DEFAULT NULL, ADD uploaded_at DATETIME DEFAULT NULL, ADD voice_status1 VARCHAR(50) NOT NULL, ADD voice_status2 VARCHAR(50) NOT NULL, ADD payment_status1 VARCHAR(50) NOT NULL, ADD payment_status2 VARCHAR(50) NOT NULL, ADD compta_status1 VARCHAR(50) DEFAULT NULL, ADD compta_status2 VARCHAR(50) DEFAULT NULL, ADD sponsor_status1 VARCHAR(50) DEFAULT NULL, ADD sponsor_status2 VARCHAR(50) DEFAULT NULL, DROP project_id');
$this->addSql('ALTER TABLE scenario_project DROP phone_required, CHANGE phone_number phone_number VARCHAR(25) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE scenario_project_types');
$this->addSql('ALTER TABLE chat_message ADD name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE scenario ADD project_id INT DEFAULT NULL, DROP status, DROP assigned_at1, DROP assigned_at2, DROP uploaded_at, DROP voice_status1, DROP voice_status2, DROP payment_status1, DROP payment_status2, DROP compta_status1, DROP compta_status2, DROP sponsor_status1, DROP sponsor_status2');
$this->addSql('ALTER TABLE scenario ADD CONSTRAINT FK_3E45C8D8166D1F9C FOREIGN KEY (project_id) REFERENCES scenario_project (id)');
$this->addSql('CREATE INDEX IDX_3E45C8D8166D1F9C ON scenario (project_id)');
$this->addSql('ALTER TABLE scenario_project ADD phone_required TINYINT(1) NOT NULL, CHANGE phone_number phone_number VARCHAR(25) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
}
}