Files
thetool/db/migrations/20240708175301_billing_add_sepa.php
2024-07-08 20:09:47 +02:00

44 lines
1.6 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class BillingAddSepa extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Billing");
$table->addColumn("sepa_date", "date", ["null" => true, "default" => null, "after" => "fibu_account_number"]);
$table->addColumn("sepa_id", "string", ["null" => true, "default" => null, "after" => "sepa_date"]);
$table->addColumn("sepa_last_date", "date", ["null" => true, "default" => null, "after" => "sepa_id"]);
$table->update();
$invoice = $this->table("Invoice");
$invoice->addColumn("sepa_date", "date", ["null" => true, "default" => null, "after" => "fibu_account_number"]);
$invoice->addColumn("sepa_id", "string", ["null" => true, "default" => null, "after" => "sepa_date"]);
$invoice->addColumn("sepa_last_date", "date", ["null" => true, "default" => null, "after" => "sepa_id"]);
$invoice->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Billing");
$table->removeColumn("sepa_date");
$table->removeColumn("sepa_id");
$table->removeColumn("sepa_last_date");
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}