Files
thetool/db/migrations/20250612124001_add_new_indexes_thetool.php
2025-06-12 12:55:47 +02:00

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();
}
}
}