27 lines
793 B
PHP
27 lines
793 B
PHP
<?php /** @noinspection ALL */
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class AddNewIndexesThetool extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if ($this->getEnvironment() == "thetool") {
|
|
$network = $this->table("Network");
|
|
$network->addIndex('adb_netzgebiet_id', ['name' => 'idx_adb_netzgebiet_id'])
|
|
->addIndex('owner_id', ['name' => 'idx_owner_id'])
|
|
->save();
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if ($this->getEnvironment() == "thetool") {
|
|
$network = $this->table("Network");
|
|
$network->removeIndexByName('idx_adb_netzgebiet_id')
|
|
->removeIndexByName('idx_owner_id')
|
|
->save();
|
|
}
|
|
}
|
|
} |