40 lines
1.0 KiB
PHP
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();
|
|
}
|
|
}
|
|
}
|