migrations/Version20230227130251.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 Version20230227130251 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql("alter table user_role drop foreign key FK_2DE8C6A3A76ED395");
  18.         $this->addSql("
  19.             alter table user_role
  20.                 add constraint FK_2DE8C6A3A76ED395
  21.                     foreign key (user_id) references user (id)
  22.                         on update cascade on delete cascade");
  23.         $this->addSql("alter table user_role drop foreign key FK_2DE8C6A3D60322AC");
  24.         $this->addSql("
  25.             alter table user_role
  26.                 add constraint FK_2DE8C6A3D60322AC
  27.                     foreign key (role_id) references role (id)
  28.                         on update cascade on delete cascade
  29.         ");
  30.     }
  31.     public function down(Schema $schema): void
  32.     {
  33.         // this down() migration is auto-generated, please modify it to your needs
  34.     }
  35. }