Added Vatgroup & Vatrate
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class CreateVatTables extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Vatgroup");
|
||||
$table->addColumn("name", "string", ["null" => false, "limit" => 255]);
|
||||
$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();
|
||||
|
||||
|
||||
$table = $this->table("Vatrate");
|
||||
$table->addColumn("vatgroup_id", "integer", ["null" => false]);
|
||||
$table->addColumn("area", "enum", ["null" => false, "values" => "domestic,eu,other"]);
|
||||
$table->addColumn("account", "integer", ["null" => false]);
|
||||
$table->addColumn("rate", "decimal", ["null" => false, "precision" => 6, "scale" => 2]);
|
||||
$table->addColumn("invoice_text", "text", ["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->create();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("Vatrate")->drop()->save();
|
||||
$this->table("Vatgroup")->drop()->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user