31 lines
731 B
PHP
31 lines
731 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class AddUnitToManualinvoiceposition extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$table = $this->table("ManualInvoiceposition");
|
|
|
|
$table->addColumn("unit", "string", [
|
|
"null" => false,
|
|
"default" => "Stk.",
|
|
"length" => 10,
|
|
"after" => "amount"
|
|
]);
|
|
|
|
$table->save();
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$this->table("ManualInvoiceposition")->removeColumn("unit")->save();
|
|
}
|
|
}
|
|
}
|