<?php
declare(strict_types=1);
namespace ProjectsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230831143147 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE projects_bundle__task_user DROP FOREIGN KEY FK_D247F12B166D1F9C');
$this->addSql('DROP INDEX IDX_D247F12B166D1F9C ON projects_bundle__task_user');
$this->addSql('DROP INDEX `primary` ON projects_bundle__task_user');
$this->addSql('ALTER TABLE projects_bundle__task_user CHANGE project_id task_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE projects_bundle__task_user ADD CONSTRAINT FK_D247F12B8DB60186 FOREIGN KEY (task_id) REFERENCES projects_bundle__task (id)');
$this->addSql('CREATE INDEX IDX_D247F12B8DB60186 ON projects_bundle__task_user (task_id)');
$this->addSql('ALTER TABLE projects_bundle__task_user ADD PRIMARY KEY (task_id, user_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE projects_bundle__task_user DROP FOREIGN KEY FK_D247F12B8DB60186');
$this->addSql('DROP INDEX IDX_D247F12B8DB60186 ON projects_bundle__task_user');
$this->addSql('DROP INDEX `PRIMARY` ON projects_bundle__task_user');
$this->addSql('ALTER TABLE projects_bundle__task_user CHANGE task_id project_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE projects_bundle__task_user ADD CONSTRAINT FK_D247F12B166D1F9C FOREIGN KEY (project_id) REFERENCES projects_bundle__task (id)');
$this->addSql('CREATE INDEX IDX_D247F12B166D1F9C ON projects_bundle__task_user (project_id)');
$this->addSql('ALTER TABLE projects_bundle__task_user ADD PRIMARY KEY (project_id, user_id)');
}
}