44 lines
1.5 KiB
PHP
44 lines
1.5 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class CreateInvoiceJob extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$table = $this->table("InvoiceJob");
|
|
$table->addColumn("task", "string", ["null" => false, "limit" => 64]);
|
|
$table->addColumn("from_date", "date", ["null" => false]);
|
|
$table->addColumn("to_date", "date", ["null" => false]);
|
|
$table->addColumn("started", "datetime", ["null" => true, "default" => null]);
|
|
$table->addColumn("finished", "datetime", ["null" => true, "default" => null]);
|
|
$table->addColumn("status", "string", ["null" => true, "default" => null, "limit" => 64]);
|
|
$table->addColumn("result", "json", ["null" => true, "default" => null]);
|
|
|
|
$table->addColumn("create_by", "integer", ["null" => false]);
|
|
$table->addColumn("edit_by", "integer", ["null" => false]);
|
|
$table->addColumn("create", "integer", ["null" => false]);
|
|
$table->addColumn("edit", "integer", ["null" => false]);
|
|
|
|
$table->save();
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$this->table("InvoiceJob")->drop()->save();
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
}
|