Merge branch 'fronkdev' into 'master'
Added MaintenanceNotification See merge request fronk/thetool!722
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<?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("address_id", "integer", ["null" => true, "default" => null]);
|
||||
$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") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class CreateMaintenancenotificationtemplate extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("MaintenanceNotificationTemplate");
|
||||
$table->addColumn("subject", "string", ["null" => false]);
|
||||
$table->addColumn("text", "text", ["null" => false]);
|
||||
|
||||
$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();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("MaintenanceNotificationTemplate")->drop()->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user