WIP PreorderPrice 2025-02-21

This commit is contained in:
Frank Schubert
2025-02-24 12:37:33 +01:00
parent fdd6ed7ebb
commit 99bdbd3b39
12 changed files with 1329 additions and 135 deletions
@@ -9,13 +9,13 @@ final class PreorderProductChange extends AbstractMigration
{
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->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->addColumn("price_setup", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4, "after" => "end_date"]);
$ppp->update();
}
@@ -27,7 +27,16 @@ final class PreorderProductChange extends AbstractMigration
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$pp = $this->table("PreorderProduct");
$pp->changeColumn("type", "enum", ["null" => false, "values" => "enduser_setup, provider_setup, provider_usage"]);
$pp->removeColumn("price_setup");
$pp->update();
$ppp = $this->table("PreorderProductPrice");
$ppp->removeColumn("netoperator_id");
$ppp->removeColumn("price_setup");
//$ppp->removeColumn("description");
$ppp->update();
}
if($this->getEnvironment() == "addressdb") {
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class PreorderProductChange2 extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$ppp = $this->table("PreorderProductPrice");
$ppp->changeColumn("netoperator_id", "integer", ["null" => true]);
$ppp->addColumn("description", "text", ["null" => true, "default" => null, "after" => "contract_term"]);
$ppp->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$ppp = $this->table("PreorderProductPrice");
$ppp->removeColumn("description");
$ppp->changeColumn("netoperator_id", "integer", ["null" => false]);
$ppp->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}
@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreatePreorderProductPriceCampaign extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$pppc = $this->table("PreorderProductPriceCampaign");
$pppc->addColumn("preorderproductprice_id", "integer", ["null" => false]);
$pppc->addColumn("preordercampaign_id", "integer", ["null" => false]);
$pppc->addColumn("create_by", "integer", ["null" => false]);
$pppc->addColumn("edit_by", "integer", ["null" => false]);
$pppc->addColumn("create", "integer", ["null" => false]);
$pppc->addColumn("edit", "integer", ["null" => false]);
$pppc->create();
$ppp = $this->table("PreorderProductPrice");
$ppp->removeColumn("preordercampaign_id");
$ppp->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("PreorderProductPriceCampaign")->drop()->save();
$this->table("PreorderProductPrice")->addColumn("preordercampaign_id", "integer", ["null" => true, "default" => null, "after" => "netowner_id"])->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}