migrations/Version20260304132132.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. final class Version20260304132132 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Create creator_notification_state table for push notification state tracking';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->addSql('CREATE TABLE creator_notification_state (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, creator_id BIGINT UNSIGNED NOT NULL, type VARCHAR(50) NOT NULL, status VARCHAR(20) NOT NULL, payload JSON DEFAULT NULL, created_at DATETIME NOT NULL, INDEX IDX_FBED4BD061220EA6 (creator_id), INDEX idx_creator_type (creator_id, type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  15.         $this->addSql('ALTER TABLE creator_notification_state ADD CONSTRAINT FK_FBED4BD061220EA6 FOREIGN KEY (creator_id) REFERENCES creator (id)');
  16.     }
  17.     public function down(Schema $schema): void
  18.     {
  19.         $this->addSql('ALTER TABLE creator_notification_state DROP FOREIGN KEY FK_FBED4BD061220EA6');
  20.         $this->addSql('DROP TABLE creator_notification_state');
  21.     }
  22. }