47 lines
1.6 KiB
PHP
47 lines
1.6 KiB
PHP
<?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") {
|
|
$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") {
|
|
|
|
}
|
|
}
|
|
}
|