48 lines
1.8 KiB
PHP
48 lines
1.8 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class CreateBillingVoicenumber extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$table = $this->table("BillingVoicenumber");
|
|
$table->addColumn("invoice_id", "integer", ["null" => true, "default" => null]);
|
|
$table->addColumn("contract_id", "integer", ["null" => false]);
|
|
$table->addColumn("owner_id", "integer", ["null" => false]);
|
|
$table->addColumn("billingaddress_id", "integer", ["null" => false]);
|
|
$table->addColumn("voicenumber", "string", ["null" => false, "limit" => 64]);
|
|
$table->addColumn("start_date", "date", ["null" => false]);
|
|
$table->addColumn("end_date", "date", ["null" => false]);
|
|
$table->addColumn("zone", "string", ["null" => false, "limit" => 64]);
|
|
$table->addColumn("duration", "integer", ["null" => false]);
|
|
$table->addColumn("price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
|
|
$table->addColumn("total_vat", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
|
|
|
|
$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->create();
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$this->table("BillingVoicenumber")->drop()->save();
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
}
|