migrations/Version20260630120000.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.  * Creator language: store the primary posting language (ISO-639-1) directly on the creator row so it
  8.  * is readable on the entity and filterable for sponsor targeting (it previously lived only in
  9.  * creator_classification.posting_language). Populated by `app:creator:backfill-language` + the
  10.  * classification pipelines. Schema-only here.
  11.  */
  12. final class Version20260630120000 extends AbstractMigration
  13. {
  14.     public function getDescription(): string
  15.     {
  16.         return 'Add language column (ISO-639-1) + index to creator';
  17.     }
  18.     public function up(Schema $schema): void
  19.     {
  20.         $this->addSql('ALTER TABLE creator ADD language VARCHAR(8) DEFAULT NULL');
  21.         $this->addSql('CREATE INDEX idx_creator_language ON creator (language)');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         $this->addSql('DROP INDEX idx_creator_language ON creator');
  26.         $this->addSql('ALTER TABLE creator DROP language');
  27.     }
  28. }