66 lines
3.5 KiB
PHP
66 lines
3.5 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class CreatePreorderBilling extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$billing = $this->table('PreorderBilling');
|
|
$billing->addColumn("invoice_id", "integer", ["null" => true]);
|
|
$billing->addColumn("preorder_id", "integer", ["null" => false]);
|
|
$billing->addColumn("order_date", "date", ["null" => false]);
|
|
$billing->addColumn("start_date", "date", ["null" => false]);
|
|
$billing->addColumn("end_date", "date", ["null" => false]);
|
|
$billing->addColumn("owner_id", "integer", ["null" => false]);
|
|
$billing->addColumn("billingaddress_id", "integer", ["null" => false]);
|
|
$billing->addColumn("fibu_account_number", "integer", ["null" => false]);
|
|
$billing->addColumn("company", "string", ["null" => true, "default" => null, "length" => 1024]);
|
|
$billing->addColumn("firstname", "string", ["null" => true, "default" => null, "length" => 1024]);
|
|
$billing->addColumn("lastname", "string", ["null" => true, "default" => null, "length" => 1024]);
|
|
$billing->addColumn("street", "string", ["null" => false, "length" => 1024]);
|
|
$billing->addColumn("zip", "string", ["null" => false, "length" => 1024]);
|
|
$billing->addColumn("city", "string", ["null" => false, "length" => 1024]);
|
|
$billing->addColumn("country", "string", ["null" => true, "default" => null, "length" => 1024]);
|
|
$billing->addColumn("email", "string", ["null" => true, "default" => null, "length" => 1024]);
|
|
$billing->addColumn("uid", "string", ["null" => true, "default" => null, "length" => 1024]);
|
|
$billing->addColumn("billing_delivery", "enum", ["null" => false, "values" => "email,paper"]);
|
|
$billing->addColumn("product_id", "integer", ["null" => false]);
|
|
$billing->addColumn("product_name", "string", ["null" => false, "length" => 255]);
|
|
$billing->addColumn("product_info", "text", ["null" => true, "default" => null]);
|
|
$billing->addColumn("article_number", "string", ["null" => false, "length" => 32]);
|
|
$billing->addColumn("amount", "decimal", ["null" => false, "precision" => 9, "scale" => 6]);
|
|
$billing->addColumn("unit", "string", ["null" => false, "length" => 64]);
|
|
$billing->addColumn("price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
|
|
$billing->addColumn("price_setup", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
|
$billing->addColumn("vatrate", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
|
|
$billing->addColumn("billing_period", "integer", ["null" => false, "default" => 0]);
|
|
$billing->addColumn("create_by", "integer", ["null" => false]);
|
|
$billing->addColumn("edit_by", "integer", ["null" => false]);
|
|
$billing->addColumn("create", "integer", ["null" => false]);
|
|
$billing->addColumn("edit", "integer", ["null" => false]);
|
|
$billing->create();
|
|
|
|
|
|
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$this->table("PreorderBilling")->drop()->save();
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
}
|