migrations/Version20230901151500.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 Version20230901151500 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('ALTER TABLE std_notifications_schedule_webusers DROP FOREIGN KEY FK_88810764E328CBE');
  19.         $this->addSql('DROP INDEX IDX_88810764E328CBE ON std_notifications_schedule_webusers');
  20.         $this->addSql('DROP INDEX `primary` ON std_notifications_schedule_webusers');
  21.         $this->addSql('ALTER TABLE std_notifications_schedule_webusers CHANGE push_notification_id notification_id INT UNSIGNED NOT NULL COMMENT \'Notification schedule unique identifier\'');
  22.         $this->addSql('ALTER TABLE std_notifications_schedule_webusers ADD CONSTRAINT FK_8881076EF1A9D84 FOREIGN KEY (notification_id) REFERENCES std_notifications_schedule (id)');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('ALTER TABLE std_notifications_schedule_webusers DROP FOREIGN KEY FK_8881076EF1A9D84');
  28.         $this->addSql('DROP INDEX IDX_8881076EF1A9D84 ON std_notifications_schedule_webusers');
  29.         $this->addSql('DROP INDEX `PRIMARY` ON std_notifications_schedule_webusers');
  30.         $this->addSql('ALTER TABLE std_notifications_schedule_webusers CHANGE notification_id push_notification_id INT UNSIGNED NOT NULL COMMENT \'Notification schedule unique identifier\'');
  31.         $this->addSql('ALTER TABLE std_notifications_schedule_webusers ADD CONSTRAINT FK_88810764E328CBE FOREIGN KEY (push_notification_id) REFERENCES std_notifications_schedule (id)');
  32.         $this->addSql('CREATE INDEX IDX_88810764E328CBE ON std_notifications_schedule_webusers (push_notification_id)');
  33.         $this->addSql('ALTER TABLE std_notifications_schedule_webusers ADD PRIMARY KEY (push_notification_id, user_id)');
  34.     }
  35. }