migrations/Version20241109120607.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20241109120607 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18. //        $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');
  19. //        $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');
  20. //        $this->addSql('ALTER TABLE command_permission ADD CONSTRAINT FK_771C7A6D33E1689A FOREIGN KEY (command_id) REFERENCES command (id)');
  21. //        $this->addSql('ALTER TABLE command_permission ADD CONSTRAINT FK_771C7A6D33ABFEBB FOREIGN KEY (type_group_id) REFERENCES type_group (id)');
  22. //        $this->addSql('ALTER TABLE role_command_permission ADD CONSTRAINT FK_5A5E7C27D60322AC FOREIGN KEY (role_id) REFERENCES role (id) ON DELETE CASCADE');
  23. //        $this->addSql('ALTER TABLE role_command_permission ADD CONSTRAINT FK_5A5E7C27E79F5007 FOREIGN KEY (command_permission_id) REFERENCES command_permission (id) ON DELETE CASCADE');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28. //        $this->addSql('ALTER TABLE role_command_permission DROP FOREIGN KEY FK_5A5E7C27E79F5007');
  29. //        $this->addSql('DROP TABLE command_permission');
  30. //        $this->addSql('DROP TABLE role_command_permission');
  31.     }
  32. }