48 lines
1.8 KiB
PHP
48 lines
1.8 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class CreatePreordercampaignOperators extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$table = $this->table("PreordercampaignOperator");
|
|
$table->addColumn("preordercampaign_id", "integer", ["null" => false]);
|
|
$table->addColumn("operator_id", "integer", ["null" => false]);
|
|
$table->addColumn("type", "enum", ["null" => false, "values" => "active,passive", "default" => "active"]);
|
|
$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();
|
|
|
|
$table = $this->table("PreordercampaignOperatorIsp");
|
|
$table->addColumn("campaignoperator_id", "integer", ["null" => false]);
|
|
$table->addColumn("isp_id", "integer", ["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("PreordercampaignOperatorIsp")->drop()->save();
|
|
$this->table("PreordercampaignOperator")->drop()->save();
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
}
|