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

Remove Store Values after Store has been removed #1171

Merged
merged 1 commit into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
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
@@ -0,0 +1,32 @@
<?php

namespace CoreShop\Bundle\CoreBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Pimcore\Migrations\Migration\AbstractPimcoreMigration;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

class Version20191113121206 extends AbstractPimcoreMigration implements ContainerAwareInterface
{
use ContainerAwareTrait;

/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$this->addSql('ALTER TABLE coreshop_product_store_values DROP FOREIGN KEY FK_9EED0E97FF575877;');
$this->addSql('ALTER TABLE coreshop_product_store_values ADD CONSTRAINT FK_9EED0E97FF575877 FOREIGN KEY (store) REFERENCES coreshop_store (id) ON DELETE CASCADE;');

$this->container->get('pimcore.cache.core.handler')->clearTag('doctrine_pimcore_cache');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CoreShop\Component\Core\Model\ProductStoreValues:
joinColumn:
name: store
referencedColumnName: id
onDelete: 'SET NULL'
onDelete: CASCADE
oneToMany:
productUnitDefinitionPrices:
targetEntity: CoreShop\Component\Core\Model\ProductUnitDefinitionPriceInterface
Expand Down