<?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 Version20240305080825 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 projects_users (project_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_8102F1D7166D1F9C (project_id), INDEX IDX_8102F1D7A76ED395 (user_id), PRIMARY KEY(project_id, user_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE projects_users ADD CONSTRAINT FK_8102F1D7166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)');
$this->addSql('ALTER TABLE projects_users ADD CONSTRAINT FK_8102F1D7A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE project ADD priority VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE scenario_project CHANGE max_scenario_duration max_scenario_duration NUMERIC(10, 2) DEFAULT \'0\' NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE projects_users');
$this->addSql('ALTER TABLE project DROP priority');
$this->addSql('ALTER TABLE scenario_project CHANGE max_scenario_duration max_scenario_duration NUMERIC(10, 2) DEFAULT \'0.00\' NOT NULL');
}
}