Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Migration] only add indices to store_price table if table actually e… #967

Merged
merged 1 commit into from
May 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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