Files
thetool/db/migrations/20240805142826_invoice_add_vatgroup_id.php
Frank Schubert a6389f014f Billing changes
2024-08-05 21:09:13 +02:00

32 lines
764 B
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class InvoiceAddVatgroupId extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('Invoice');
$table->addColumn("vatgroup_id", "integer", ["null" => false, "after" => "total_gross"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table('Invoice')->removeColumn("vatgroup_id")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}