Added payment_due and skonto to Address and Invoice
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddressAddPaymentDue extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$address = $this->table("Address");
|
||||
$address->addColumn("fibu_payment_due", "integer", ["null" => true, "default" => null, "after" => "fibu_account_number"]);
|
||||
$address->addColumn("fibu_payment_skonto", "integer", ["null" => true, "default" => null, "after" => "fibu_payment_due"]);
|
||||
$address->addColumn("fibu_payment_skonto_rate", "integer", ["null" => true, "default" => null, "after" => "fibu_payment_skonto"]);
|
||||
$address->update();
|
||||
|
||||
$invoice = $this->table("Invoice");
|
||||
$invoice->addColumn("fibu_payment_due", "integer", ["null" => true, "default" => null, "after" => "fibu_account_number"]);
|
||||
$invoice->addColumn("fibu_payment_skonto", "integer", ["null" => false, "default" => 0, "after" => "fibu_payment_due"]);
|
||||
$invoice->addColumn("fibu_payment_skonto_rate", "integer", ["null" => false, "default" => 0, "after" => "fibu_payment_skonto"]);
|
||||
$invoice->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$address = $this->table("Address");
|
||||
$address->removeColumn("fibu_payment_skonto_rate");
|
||||
$address->removeColumn("fibu_payment_skonto");
|
||||
$address->removeColumn("fibu_payment_due");
|
||||
$address->update();
|
||||
|
||||
$invoice = $this->table("Invoice");
|
||||
$invoice->removeColumn("fibu_payment_skonto_rate");
|
||||
$invoice->removeColumn("fibu_payment_skonto");
|
||||
$invoice->removeColumn("fibu_payment_due");
|
||||
$invoice->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user