<?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 Version20230901151500 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 std_notifications_schedule_webusers DROP FOREIGN KEY FK_88810764E328CBE');
$this->addSql('DROP INDEX IDX_88810764E328CBE ON std_notifications_schedule_webusers');
$this->addSql('DROP INDEX `primary` ON std_notifications_schedule_webusers');
$this->addSql('ALTER TABLE std_notifications_schedule_webusers CHANGE push_notification_id notification_id INT UNSIGNED NOT NULL COMMENT \'Notification schedule unique identifier\'');
$this->addSql('ALTER TABLE std_notifications_schedule_webusers ADD CONSTRAINT FK_8881076EF1A9D84 FOREIGN KEY (notification_id) REFERENCES std_notifications_schedule (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE std_notifications_schedule_webusers DROP FOREIGN KEY FK_8881076EF1A9D84');
$this->addSql('DROP INDEX IDX_8881076EF1A9D84 ON std_notifications_schedule_webusers');
$this->addSql('DROP INDEX `PRIMARY` ON std_notifications_schedule_webusers');
$this->addSql('ALTER TABLE std_notifications_schedule_webusers CHANGE notification_id push_notification_id INT UNSIGNED NOT NULL COMMENT \'Notification schedule unique identifier\'');
$this->addSql('ALTER TABLE std_notifications_schedule_webusers ADD CONSTRAINT FK_88810764E328CBE FOREIGN KEY (push_notification_id) REFERENCES std_notifications_schedule (id)');
$this->addSql('CREATE INDEX IDX_88810764E328CBE ON std_notifications_schedule_webusers (push_notification_id)');
$this->addSql('ALTER TABLE std_notifications_schedule_webusers ADD PRIMARY KEY (push_notification_id, user_id)');
}
}