added new 8 week notice email

This commit is contained in:
Luca Haid
2025-06-05 10:14:23 +02:00
parent d9ce9da876
commit 73e3b49e0d
5 changed files with 199 additions and 3 deletions
@@ -0,0 +1,58 @@
<?php
declare(strict_types = 1);
use Phinx\Migration\AbstractMigration;
final class PreorderNotificationLogModify extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
$PreorderStatusnotificationLogTable = $this->table("PreorderStatusnotificationLog");
if ($PreorderStatusnotificationLogTable->hasColumn("status_code")) {
$PreorderStatusnotificationLogTable
->changeColumn("status_code", "integer", ["null" => true])
->update();
}
if (!$PreorderStatusnotificationLogTable->hasColumn("email_type")) {
$PreorderStatusnotificationLogTable
->addColumn("email_type", "string", [
"limit" => 50,
"null" => true,
"after" => "email"
])
->update();
}
if (!$PreorderStatusnotificationLogTable->hasIndex(["email_type"])) {
$PreorderStatusnotificationLogTable
->addIndex(["email_type"], ["name" => "idx_email_type"])
->update();
}
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
$PreorderStatusnotificationLogTable = $this->table("PreorderStatusnotificationLog");
if ($PreorderStatusnotificationLogTable->hasIndex(["email_type"])) {
$PreorderStatusnotificationLogTable
->removeIndex(["email_type"])
->update();
}
if ($PreorderStatusnotificationLogTable->hasColumn("email_type")) {
$PreorderStatusnotificationLogTable
->removeColumn("email_type")
->update();
}
if ($PreorderStatusnotificationLogTable->hasColumn("status_code")) {
$PreorderStatusnotificationLogTable
->changeColumn("status_code", "integer", ["null" => false])
->update();
}
}
}
}