<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260304132132 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create creator_notification_state table for push notification state tracking';
}
public function up(Schema $schema): void
{
$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');
$this->addSql('ALTER TABLE creator_notification_state ADD CONSTRAINT FK_FBED4BD061220EA6 FOREIGN KEY (creator_id) REFERENCES creator (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE creator_notification_state DROP FOREIGN KEY FK_FBED4BD061220EA6');
$this->addSql('DROP TABLE creator_notification_state');
}
}