diff --git a/src/CoreShop/Bundle/CoreBundle/Migrations/Version20190430134834.php b/src/CoreShop/Bundle/CoreBundle/Migrations/Version20190430134834.php new file mode 100644 index 0000000000..b51cfad560 --- /dev/null +++ b/src/CoreShop/Bundle/CoreBundle/Migrations/Version20190430134834.php @@ -0,0 +1,31 @@ +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);'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + // this down() migration is auto-generated, please modify it to your needs + + } +} diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/config/doctrine/model/ProductStorePrice.orm.yml b/src/CoreShop/Bundle/CoreBundle/Resources/config/doctrine/model/ProductStorePrice.orm.yml index 7a8eea2127..bba481d33c 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/config/doctrine/model/ProductStorePrice.orm.yml +++ b/src/CoreShop/Bundle/CoreBundle/Resources/config/doctrine/model/ProductStorePrice.orm.yml @@ -14,6 +14,7 @@ CoreShop\Component\Core\Model\ProductStorePrice: property: column: property type: string + length: 190 price: column: price type: integer @@ -23,4 +24,7 @@ CoreShop\Component\Core\Model\ProductStorePrice: joinColumn: name: storeId referencedColumnName: id - onDelete: 'SET NULL' \ No newline at end of file + onDelete: 'SET NULL' + indexes: + - columns: productId, property + - columns: productId, storeId, property