WIP Voiceplan Zones
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddVoiceplanZone extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Voiceplanzone");
|
||||
$table->addColumn("voiceplan_id", "integer", ["null" => false]);
|
||||
$table->addColumn("name", "string", ["null" => false, "limit" => 255]);
|
||||
$table->addColumn("purchase_price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
|
||||
$table->addColumn("price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
|
||||
$table->addColumn("increment_first", "integer", ["null" => false, "default" => 60]);
|
||||
$table->addColumn("increment", "integer", ["null" => false, "default" => 30]);
|
||||
$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();
|
||||
|
||||
$table = $this->table("Voiceplandestination");
|
||||
$table->removeColumn("purchase_price");
|
||||
$table->removeColumn("price");
|
||||
$table->removeColumn("increment_first");
|
||||
$table->removeColumn("increment");
|
||||
$table->renameColumn("voiceplan_id", "voiceplanzone_id");
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Voiceplandestination");
|
||||
$table->renameColumn("voiceplanzone_id", "voiceplan_id");
|
||||
$table->addColumn("purchase_price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
|
||||
$table->addColumn("price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
|
||||
$table->addColumn("increment_first", "integer", ["null" => false, "default" => 1]);
|
||||
$table->addColumn("increment", "integer", ["null" => false, "default" => 1]);
|
||||
$table->update();
|
||||
|
||||
$this->table("Voiceplanzone")->drop()->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user