added rml unscheduled check

This commit is contained in:
Luca Haid
2025-06-12 12:54:01 +02:00
parent f94c622839
commit cd0629dfbc
4 changed files with 172 additions and 152 deletions

View File

@@ -0,0 +1,42 @@
<?php /** @noinspection ALL */
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddNewIndexesAdb extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "addressdb") {
$wohneinheit = $this->table("Wohneinheit");
$wohneinheit->removeIndexByName('oaid')
->addIndex('oaid', ['name' => 'idx_oaid_full'])
->save();
$wohneinheit->removeIndexByName('extref')
->addIndex('extref', ['name' => 'idx_extref_full'])
->save();
}
}
public function down(): void
{
if ($this->getEnvironment() == "addressdb") {
$wohneinheit = $this->table("Wohneinheit");
$wohneinheit->removeIndexByName('idx_oaid_full')
->addIndex('oaid', [
'name' => 'oaid',
'limit' => 10
])
->save();
$wohneinheit->removeIndexByName('idx_extref_full')
->addIndex('extref', [
'name' => 'extref',
'limit' => 10
])
->save();
}
}
}

View File

@@ -0,0 +1,35 @@
<?php /** @noinspection ALL */
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddNewIndexesThetool extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$workerPermission = $this->table("WorkerPermission");
$workerPermission->addColumn("canADBExtended", "enum", ["null" => false, "values" => 'false,true', "default" => "false", "after" => "canSuperexpert"])
->update();
$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") {
$workerPermission = $this->table("WorkerPermission");
$workerPermission->removeColumn("canADBExtended")
->save();
$network = $this->table("Network");
$network->removeIndexByName('idx_adb_netzgebiet_id')
->removeIndexByName('idx_owner_id')
->save();
}
}
}