Files
thetool/db/migrations/20250312152751_preorder_billing_add_customer_id.php
2025-03-17 12:22:03 +01:00

36 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class PreorderBillingAddCustomerId extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('PreorderBilling');
$table->addColumn("preorderbillingcustomer_id", "integer", ["null" => true, "default" => null, "after" => "end_date"]);
$table->changeColumn("owner_id", "integer", ["null" => true, "default" => null]);
$table->changeColumn("billingaddress_id", "integer", ["null" => true, "default" => null]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('PreorderBilling');
$table->removeColumn("preorderbillingcustomer_id");
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}