Added contract_id to Voicecallhistory
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class VoicecallhistoryAddContractId extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("VoiceCallHistory");
|
||||
$table->addColumn("contract_id", "integer", ["null" => true, "default" => null, "after" => "voice_account"]);
|
||||
$table->addIndex("contract_id");
|
||||
|
||||
$table->addColumn("create_by", "integer", ["null" => false, "default" => 1]);
|
||||
$table->addColumn("edit_by", "integer", ["null" => false, "default" => 1]);
|
||||
$table->addColumn("create", "integer", ["null" => false, "default" => 0]);
|
||||
$table->addColumn("edit", "integer", ["null" => false, "default" => 0]);
|
||||
|
||||
$table->update();
|
||||
|
||||
$table->changeColumn("create_by", "integer", ["null" => false]);
|
||||
$table->changeColumn("edit_by", "integer", ["null" => false]);
|
||||
$table->changeColumn("create", "integer", ["null" => false]);
|
||||
$table->changeColumn("edit", "integer", ["null" => false]);
|
||||
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("VoiceCallHistory");
|
||||
|
||||
$table->removeColumn("contract_id");
|
||||
$table->removeColumn("create_by");
|
||||
$table->removeColumn("edit_by");
|
||||
$table->removeColumn("create");
|
||||
$table->removeColumn("edit");
|
||||
|
||||
$table->update();
|
||||
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user