27 lines
1003 B
PHP
27 lines
1003 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class ModifyPreordercampaign 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();
|
|
}
|
|
} |