added new preorderiframe

This commit is contained in:
Luca Haid
2025-06-24 09:41:48 +02:00
parent 40c5cbfcb3
commit 2f1167d4d0
9 changed files with 1264 additions and 4 deletions
@@ -0,0 +1,35 @@
<?php /** @noinspection ALL */
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddNewIndexesThetool extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$Preordercampaign = $this->table("Preordercampaign");
$Preordercampaign->addColumn('iframe_origins', 'json', [
'null' => true,
'default' => null,
'comment' => 'JSON array of allowed CORS origins for the IFrame, e.g., ["https://partner-a.com", "https://partner-b.de"]'
]);
$Preordercampaign->addColumn('iframe_consents', 'json', [
'null' => true,
'default' => null,
'comment' => 'JSON array of consent information for the IFrame, e.g., [{url: "https://partner-a.com", text: "Partner A Consent", required: true, replace: "Consent"}, {url: "https://partner-b.de", text: "Partner B Consent", required: false, replace: "Consent"}]'
]);
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$Preordercampaign = $this->table("Preordercampaign");
$Preordercampaign->removeColumn('iframe_origins')
->removeColumn('iframe_consents')
->update();
}
}
}