added v2 of cpeprov
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class CpeprovAddNewIndexes extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if ($this->getEnvironment() == 'thetool') {
|
||||
$orderProduct = $this->table('OrderProduct');
|
||||
$orderProduct->addIndex('product_id', ['name' => 'idx_product_id'])
|
||||
->addIndex('termination_id', ['name' => 'idx_termination_id'])
|
||||
->save();
|
||||
|
||||
$product = $this->table('Product');
|
||||
$product->addIndex('producttech_id', ['name' => 'idx_producttech_id'])
|
||||
->save();
|
||||
|
||||
$productAttribute = $this->table('ProductAttribute');
|
||||
$productAttribute->addIndex('producttechattribute_id', ['name' => 'idx_producttechattribute_id'])
|
||||
->save();
|
||||
|
||||
$termination = $this->table('Termination');
|
||||
$termination->addIndex('status_id', ['name' => 'idx_status_id'])
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->getEnvironment() == 'thetool') {
|
||||
$orderProduct = $this->table('OrderProduct');
|
||||
$orderProduct->removeIndexByName('idx_product_id')
|
||||
->removeIndexByName('idx_termination_id')
|
||||
->save();
|
||||
|
||||
$product = $this->table('Product');
|
||||
$product->removeIndexByName('idx_producttech_id')
|
||||
->save();
|
||||
|
||||
$productAttribute = $this->table('ProductAttribute');
|
||||
$productAttribute->removeIndexByName('idx_producttechattribute_id')
|
||||
->save();
|
||||
|
||||
$termination = $this->table('Termination');
|
||||
$termination->removeIndexByName('idx_status_id')
|
||||
->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user