added new 8 week notice email
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user