Files
thetool/db/migrations/20250114141019_create_mailtemplate_dispatch.php
2025-01-14 20:03:19 +01:00

50 lines
2.1 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateMailtemplateDispatch extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("MailtemplateDispatch");
$table->addColumn("mailtemplate_id", "integer", ["null" => false]);
$table->addColumn("sender_email", "string", ["null" => false, "limit" => 64]);
$table->addColumn("sender_name", "string", ["null" => false, "limit" => 64]);
$table->addColumn("sender_replyto", "string", ["null" => true, "default" => null, "limit" => 64]);
$table->addColumn("tosend_date", "integer", ["null" => true, "default" => null]);
$table->addColumn("send_start", "integer", ["null" => true, "default" => null]);
$table->addColumn("send_finish", "integer", ["null" => true, "default" => null]);
$table->addColumn("send_lock", "integer", ["null" => true, "default" => null]);
$table->addColumn("recipient_count", "integer", ["null" => false, "default" => 0]);
$table->addColumn("subject", "string", ["null" => false, "limit" => 255]);
$table->addColumn("filter_datasource", "json", ["null" => true, "default" => null]);
$table->addColumn("recipient_filter", "json", ["null" => true, "default" => null]);
$table->addColumn("note", "text", ["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();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("MailtemplateDispatch")->drop()->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}