Files
thetool/db/migrations/20250917103001_modify_preordercampaign2.php
2025-09-17 11:26:11 +00:00

28 lines
1005 B
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class ModifyPreordercampaign2 extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() !== 'thetool') return;
$sql = <<<SQL
ALTER TABLE `Preordercampaign`
ADD COLUMN `rimo_type_map_faults` JSON DEFAULT NULL AFTER `banned_rimo_fcp`,
MODIFY COLUMN `iframe_origins` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Allowed IFrame CORS origins' CHECK (json_valid(`iframe_origins`)),
MODIFY COLUMN `iframe_consents` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'IFrame consent configurations' CHECK (json_valid(`iframe_consents`));
SQL;
$this->execute($sql);
}
public function down(): void {
if ($this->getEnvironment() !== 'thetool') return;
$this->table('Preordercampaign')
->removeColumn('rimo_type_map_faults')
->save();
}
}