Skip to content

Commit

Permalink
Merge pull request #967 from dpfaffenbauer/fix-migration
Browse files Browse the repository at this point in the history
[Migration] only add indices to store_price table if table actually e…
  • Loading branch information
dpfaffenbauer authored May 2, 2019
2 parents a7203f6 + 1763e4e commit 80653d7
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ class Version20190430134834 extends AbstractPimcoreMigration
*/
public function up(Schema $schema)
{
$this->addSql('ALTER TABLE coreshop_product_store_price CHANGE property property VARCHAR(190) NOT NULL;');
$this->addSql('CREATE INDEX IDX_514E3EBF367996058BF21CDE ON coreshop_product_store_price (productId, property);');
$this->addSql('CREATE INDEX IDX_514E3EBF367996052F738A528BF21CDE ON coreshop_product_store_price (productId, storeId, property);');
if ($schema->hasTable('coreshop_product_store_price')) {
$this->addSql('ALTER TABLE coreshop_product_store_price CHANGE property property VARCHAR(190) NOT NULL;');
$this->addSql('CREATE INDEX IDX_514E3EBF367996058BF21CDE ON coreshop_product_store_price (productId, property);');
$this->addSql('CREATE INDEX IDX_514E3EBF367996052F738A528BF21CDE ON coreshop_product_store_price (productId, storeId, property);');
}
}

/**
Expand Down

0 comments on commit 80653d7

Please sign in to comment.