<?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 Version20241109120607 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 command_permission (id INT AUTO_INCREMENT NOT NULL, command_id INT DEFAULT NULL, type_group_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, typeof VARCHAR(255) DEFAULT NULL, is_active TINYINT(1) DEFAULT \'1\', INDEX IDX_771C7A6D33E1689A (command_id), INDEX IDX_771C7A6D33ABFEBB (type_group_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
// $this->addSql('CREATE TABLE role_command_permission (role_id INT NOT NULL, command_permission_id INT NOT NULL, INDEX IDX_5A5E7C27D60322AC (role_id), INDEX IDX_5A5E7C27E79F5007 (command_permission_id), PRIMARY KEY(role_id, command_permission_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
// $this->addSql('ALTER TABLE command_permission ADD CONSTRAINT FK_771C7A6D33E1689A FOREIGN KEY (command_id) REFERENCES command (id)');
// $this->addSql('ALTER TABLE command_permission ADD CONSTRAINT FK_771C7A6D33ABFEBB FOREIGN KEY (type_group_id) REFERENCES type_group (id)');
// $this->addSql('ALTER TABLE role_command_permission ADD CONSTRAINT FK_5A5E7C27D60322AC FOREIGN KEY (role_id) REFERENCES role (id) ON DELETE CASCADE');
// $this->addSql('ALTER TABLE role_command_permission ADD CONSTRAINT FK_5A5E7C27E79F5007 FOREIGN KEY (command_permission_id) REFERENCES command_permission (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
// $this->addSql('ALTER TABLE role_command_permission DROP FOREIGN KEY FK_5A5E7C27E79F5007');
// $this->addSql('DROP TABLE command_permission');
// $this->addSql('DROP TABLE role_command_permission');
}
}