Files
thetool/db/migrations/20241112130541_create_maintanence_notification.php
2024-11-13 18:15:24 +01:00

57 lines
2.2 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateMaintanenceNotification extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("MaintenanceNotification");
$table->addColumn("subject_id", "integer", ["null" => false]);
$table->addColumn("text", "text", ["null" => false]);
$table->addColumn("plz", "json", ["null" => true, "default" => null]);
$table->addColumn("from", "integer", ["null" => true]);
$table->addColumn("to", "integer", ["null" => true]);
$table->addColumn("send_ts", "integer", ["null" => true]);
$table->addColumn("sent", "integer", ["null" => true, "default" => null]);
$table->addColumn("sent_by", "integer", ["null" => true, "default" => null]);
$table->addColumn("create_by", "integer", ["null" => false]);
$table->addColumn("edit_by", "integer", ["null" => false]);
$table->addColumn("create", "integer", ["null" => false]);
$table->addColumn("edit", "integer", ["null" => false]);
$table->create();
$log = $this->table("MaintenanceNotificationLog");
$log->addColumn("maintenancenotification_id", "integer", ["null" => false]);
$log->addColumn("email", "string", ["null" => false]);
$log->addColumn("sent", "integer", ["null" => false, "default" => 0]);
$log->addColumn("create_by", "integer", ["null" => false]);
$log->addColumn("edit_by", "integer", ["null" => false]);
$log->addColumn("create", "integer", ["null" => false]);
$log->addColumn("edit", "integer", ["null" => false]);
$log->create();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("MaintenanceNotificationLog")->drop()->save();
$this->table("MaintenanceNotification")->drop()->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}