Files
thetool/db/migrations/20260113120000_add_lock_exported_to_manualinvoice.php
2026-01-13 07:07:03 +01:00

40 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddLockExportedToManualinvoice extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("ManualInvoice");
$table->addColumn("lock", "integer", [
"null" => false,
"default" => 0,
"limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY,
"after" => "status"
]);
$table->addColumn("exported", "integer", [
"null" => false,
"default" => 0,
"limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY,
"after" => "lock"
]);
$table->save();
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("ManualInvoice");
$table->removeColumn("lock")->save();
$table->removeColumn("exported")->save();
}
}
}