Files
thetool/db/migrations/20231212142423_address_add_fibubillingnumber_suppliernumber.php

38 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddressAddFibubillingnumberSuppliernumber extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Address");
$table->addColumn("fibu_account_number","integer", ["null" => true, "default" => null, "after" => "customer_number"]);
$table->addColumn("fibu_supplier_number","integer", ["null" => true, "default" => null, "after" => "fibu_account_number"]);
$table->addColumn("fibu_primary_account","integer", ["null" => false, "default" => 0, "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY, "after" => "fibu_supplier_number"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Address");
$table->removeColumn("fibu_primary_account");
$table->removeColumn("fibu_supplier_number");
$table->removeColumn("fibu_account_number");
$table->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}