Merge branch 'Preorder/add-iframe' into 'master'

added new preorderiframe

See merge request fronk/thetool!1479
This commit is contained in:
Luca Haid
2025-06-24 07:46:33 +00:00
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();
}
}
}