40 lines
1.4 KiB
PHP
40 lines
1.4 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class PopNetwork extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$popnetwork = $this->table("PopNetwork", ['signed' => true]);
|
|
$popnetwork->addColumn("pop_id", "integer", ["null" => false])->addIndex(['pop_id']);
|
|
$popnetwork->addColumn("network_id", "integer", ["null" => false])->addIndex(['network_id']);
|
|
$popnetwork->addColumn("create_by", "integer", ["null" => false]);
|
|
$popnetwork->addColumn("edit_by", "integer", ["null" => false]);
|
|
$popnetwork->addColumn("create", "integer", ["null" => false]);
|
|
$popnetwork->addColumn("edit", "integer", ["null" => false]);
|
|
$popnetwork->save();
|
|
|
|
$this->table("Pop")->changeColumn("network_id", "integer", ["null" => true, "default" => null])->save();
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$this->table("Pop")->changeColumn("network_id", "integer", ["null" => false])->save();
|
|
$this->table("PopNetwork")->drop()->save();
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
}
|