added new fcp statistics
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddRimoFcpIndex extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
$table = $this->table('Hausnummer');
|
||||
if (!$table->hasIndexByName('idx_fcp_id_rimo_type')) {
|
||||
$table->addIndex(['fcp_id', 'rimo_type'], ['name' => 'idx_fcp_id_rimo_type'])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table('Preorder');
|
||||
if (!$table->hasIndexByName('idx_adb_hausnummer_id')) {
|
||||
$table->addIndex(['adb_hausnummer_id'], ['name' => 'idx_adb_hausnummer_id']);
|
||||
}
|
||||
if (!$table->hasIndexByName('idx_status_id')) {
|
||||
$table->addIndex(['status_id'], ['name' => 'idx_status_id']);
|
||||
}
|
||||
$table->update();
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
$table = $this->table('Hausnummer');
|
||||
if ($table->hasIndexByName('idx_fcp_id_rimo_type')) {
|
||||
$table->removeIndexByName('idx_fcp_id_rimo_type')
|
||||
->update();
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table('Preorder');
|
||||
if ($table->hasIndexByName('idx_adb_hausnummer_id')) {
|
||||
$table->removeIndexByName('idx_adb_hausnummer_id');
|
||||
}
|
||||
if ($table->hasIndexByName('idx_status_id')) {
|
||||
$table->removeIndexByName('idx_status_id');
|
||||
}
|
||||
$table->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user