WIP PreorderProduct 2025-02-17
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class CreatePreorderProduct extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$po = $this->table("Preorder");
|
||||
$po->addColumn("rimo_service_id", "integer", ["null" => true, "default" => null]);
|
||||
$po->update();
|
||||
|
||||
$pp = $this->table("PreorderProduct");
|
||||
$pp->addColumn("type", "enum", ["null" => false, "values" => "enduser_setup, provider_setup, provider_usage"]);
|
||||
$pp->addColumn("name", "string", ["null" => true, "default" => null, "length" => 64]);
|
||||
$pp->addColumn("vatgroup_id", "integer", ["null" => true, "default" => null]);
|
||||
$pp->addColumn("price_inet", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$pp->addColumn("price_inet_tv", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$pp->addColumn("price_catv", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$pp->addColumn("price_passive", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$pp->addColumn("create_by", "integer", ["null" => false]);
|
||||
$pp->addColumn("edit_by", "integer", ["null" => false]);
|
||||
$pp->addColumn("create", "integer", ["null" => false]);
|
||||
$pp->addColumn("edit", "integer", ["null" => false]);
|
||||
$pp->create();
|
||||
|
||||
$ppp = $this->table("PreorderProductPrice");
|
||||
$ppp->addColumn("preorderproduct_id", "integer", ["null" => false]);
|
||||
$ppp->addColumn("netowner_id", "integer", ["null" => false]);
|
||||
$ppp->addColumn("preordercampaign_id", "integer", ["null" => true, "default" => null]);
|
||||
$ppp->addColumn("description", "text", ["null" => true, "default" => null]);
|
||||
$ppp->addColumn("start_date", "date", ["null" => true, "default" => null]);
|
||||
$ppp->addColumn("end_date", "date", ["null" => true, "default" => null]);
|
||||
$ppp->addColumn("price_inet", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppp->addColumn("price_inet_tv", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppp->addColumn("price_catv", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppp->addColumn("price_passive", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppp->addColumn("billing_delay", "integer", ["null" => false, "default" => 0]);
|
||||
$ppp->addColumn("billing_period", "integer", ["null" => true, "default" => null]);
|
||||
$ppp->addColumn("contract_term", "integer", ["null" => true, "default" => null]);
|
||||
$ppp->addColumn("note", "text", ["null" => true, "default" => null]);
|
||||
$ppp->addColumn("create_by", "integer", ["null" => false]);
|
||||
$ppp->addColumn("edit_by", "integer", ["null" => false]);
|
||||
$ppp->addColumn("create", "integer", ["null" => false]);
|
||||
$ppp->addColumn("edit", "integer", ["null" => false]);
|
||||
$ppp->create();
|
||||
|
||||
$ppmd = $this->table("PreorderProductMarketshareDiscount");
|
||||
$ppmd->addColumn("preorderproductprice_id", "integer", ["null" => false]);
|
||||
$ppmd->addColumn("price_15", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppmd->addColumn("price_20", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppmd->addColumn("price_25", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppmd->addColumn("price_30", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppmd->addColumn("price_35", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppmd->addColumn("price_40", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppmd->addColumn("price_45", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppmd->addColumn("price_50", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
|
||||
$ppmd->addColumn("create_by", "integer", ["null" => false]);
|
||||
$ppmd->addColumn("edit_by", "integer", ["null" => false]);
|
||||
$ppmd->addColumn("create", "integer", ["null" => false]);
|
||||
$ppmd->addColumn("edit", "integer", ["null" => false]);
|
||||
$ppmd->create();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("PreorderProductMarketshareDiscount")->drop()->save();
|
||||
$this->table("PreorderProductPrice")->drop()->save();
|
||||
$this->table("PreorderProduct")->drop()->save();
|
||||
$this->table("Preorder")->removeColumn("rimo_service_id")->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class PreorderProductChange extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$pp = $this->table("PreorderProduct");
|
||||
//$pp->changeColumn("type", "enum", ["null" => false, "values" => "enduser_setup, operator_setup, operator_usage"]);
|
||||
//$pp->addColumn("price_setup", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4, "after" => "vatgroup_id"]);
|
||||
$pp->update();
|
||||
|
||||
$ppp = $this->table("PreorderProductPrice");
|
||||
$ppp->addColumn("netoperator_id", "integer", ["null" => false, "after" => "netowner_id"]);
|
||||
//$ppp->addColumn("price_setup", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4, "after" => "end_date"]);
|
||||
$ppp->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user