47 lines
2.2 KiB
PHP
47 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class AddIndexesForOrder extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if ($this->getEnvironment() == "thetool") {
|
|
$this->execute("ALTER TABLE `ProducttechAttribute` ADD INDEX `producttech_id` (`producttech_id`)");
|
|
$this->execute("ALTER TABLE `Worker` ADD INDEX `username` (`username`)");
|
|
$this->execute("ALTER TABLE `OrderProduct` ADD INDEX `order_id` (`order_id`)");
|
|
$this->execute("ALTER TABLE `Patching` ADD INDEX `termination_id` (`termination_id`)");
|
|
$this->execute("ALTER TABLE `OrderJournal` ADD INDEX `order_id` (`order_id`)");
|
|
$this->execute("ALTER TABLE `OrderFile` ADD INDEX `file_id` (`file_id`)");
|
|
$this->execute("ALTER TABLE `OrderFile` ADD INDEX `order_id` (`order_id`)");
|
|
$this->execute("ALTER TABLE `Networksection` ADD INDEX `network_id` (`network_id`)");
|
|
$this->execute("ALTER TABLE `WorkerPermission` ADD INDEX `worker_id` (`worker_id`)");
|
|
$this->execute("ALTER TABLE `WorkerFlag` ADD INDEX `network_id` (`worker_id`)");
|
|
}
|
|
|
|
if ($this->getEnvironment() == "addressdb") {
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if ($this->getEnvironment() == "thetool") {
|
|
$this->execute("ALTER TABLE `ProducttechAttribute` DROP INDEX `producttech_id`");
|
|
$this->execute("ALTER TABLE `Worker` DROP INDEX `username`");
|
|
$this->execute("ALTER TABLE `OrderProduct` DROP INDEX `order_id`");
|
|
$this->execute("ALTER TABLE `Patching` DROP INDEX `termination_id`");
|
|
$this->execute("ALTER TABLE `OrderJournal` DROP INDEX `order_id`");
|
|
$this->execute("ALTER TABLE `OrderFile` DROP INDEX `file_id`");
|
|
$this->execute("ALTER TABLE `OrderFile` DROP INDEX `order_id`");
|
|
$this->execute("ALTER TABLE `Networksection` DROP INDEX `network_id`");
|
|
$this->execute("ALTER TABLE `WorkerPermission` DROP INDEX `worker_id`");
|
|
$this->execute("ALTER TABLE `WorkerFlag` DROP INDEX `worker_id`");
|
|
}
|
|
|
|
if ($this->getEnvironment() == "addressdb") {
|
|
}
|
|
}
|
|
}
|