<?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 Version20230712104102 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('ALTER TABLE permission_role_permissions DROP FOREIGN KEY FK_9E253DC99C3E4F87');
// $this->addSql('ALTER TABLE permission_role_permissions DROP FOREIGN KEY FK_9E253DC9E112C3FB');
// $this->addSql('DROP TABLE permission_role_permissions');
// $this->addSql('ALTER TABLE permission_role MODIFY id INT NOT NULL');
// $this->addSql('DROP INDEX `primary` ON permission_role');
// $this->addSql('ALTER TABLE permission_role ADD permission_id INT NOT NULL, ADD role_id INT NOT NULL');
// $this->addSql('ALTER TABLE permission_role ADD CONSTRAINT FK_6A711CAFED90CCA FOREIGN KEY (permission_id) REFERENCES permissions (id)');
// $this->addSql('ALTER TABLE permission_role ADD CONSTRAINT FK_6A711CAD60322AC FOREIGN KEY (role_id) REFERENCES role (id)');
// $this->addSql('CREATE INDEX IDX_6A711CAFED90CCA ON permission_role (permission_id)');
// $this->addSql('CREATE INDEX IDX_6A711CAD60322AC ON permission_role (role_id)');
// $this->addSql('ALTER TABLE permission_role ADD PRIMARY KEY (permission_id, role_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
// $this->addSql('CREATE TABLE permission_role_permissions (permission_role_id INT NOT NULL, permissions_id INT NOT NULL, INDEX IDX_9E253DC99C3E4F87 (permissions_id), INDEX IDX_9E253DC9E112C3FB (permission_role_id), PRIMARY KEY(permission_role_id, permissions_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
// $this->addSql('ALTER TABLE permission_role_permissions ADD CONSTRAINT FK_9E253DC99C3E4F87 FOREIGN KEY (permissions_id) REFERENCES permissions (id) ON UPDATE NO ACTION ON DELETE CASCADE');
// $this->addSql('ALTER TABLE permission_role_permissions ADD CONSTRAINT FK_9E253DC9E112C3FB FOREIGN KEY (permission_role_id) REFERENCES permission_role (id) ON UPDATE NO ACTION ON DELETE CASCADE');
// $this->addSql('ALTER TABLE permission_role DROP FOREIGN KEY FK_6A711CAFED90CCA');
// $this->addSql('ALTER TABLE permission_role DROP FOREIGN KEY FK_6A711CAD60322AC');
// $this->addSql('DROP INDEX IDX_6A711CAFED90CCA ON permission_role');
// $this->addSql('DROP INDEX IDX_6A711CAD60322AC ON permission_role');
// $this->addSql('ALTER TABLE permission_role ADD id INT AUTO_INCREMENT NOT NULL, DROP permission_id, DROP role_id, DROP PRIMARY KEY, ADD PRIMARY KEY (id)');
}
}