-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from delyriand/fix/delete-shop-user
Avoid SQL error if we try to delete shop user
- Loading branch information
Showing
4 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Monsieur Biz' Order History plugin for Sylius. | ||
* | ||
* (c) Monsieur Biz <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MonsieurBiz\SyliusOrderHistoryPlugin\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
final class Version20240730093001 extends AbstractMigration | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return ''; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
// this up() migration is auto-generated, please modify it to your needs | ||
$this->addSql('ALTER TABLE monsieurbiz_order_history_event DROP FOREIGN KEY FK_9EA44E026352511C'); | ||
$this->addSql('ALTER TABLE monsieurbiz_order_history_event DROP FOREIGN KEY FK_9EA44E02A45D93BF'); | ||
$this->addSql('ALTER TABLE monsieurbiz_order_history_event ADD CONSTRAINT FK_9EA44E026352511C FOREIGN KEY (admin_user_id) REFERENCES sylius_admin_user (id) ON DELETE SET NULL'); | ||
$this->addSql('ALTER TABLE monsieurbiz_order_history_event ADD CONSTRAINT FK_9EA44E02A45D93BF FOREIGN KEY (shop_user_id) REFERENCES sylius_shop_user (id) ON DELETE CASCADE'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
$this->addSql('ALTER TABLE monsieurbiz_order_history_event DROP FOREIGN KEY FK_9EA44E02A45D93BF'); | ||
$this->addSql('ALTER TABLE monsieurbiz_order_history_event DROP FOREIGN KEY FK_9EA44E026352511C'); | ||
$this->addSql('ALTER TABLE monsieurbiz_order_history_event ADD CONSTRAINT FK_9EA44E02A45D93BF FOREIGN KEY (shop_user_id) REFERENCES sylius_shop_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION'); | ||
$this->addSql('ALTER TABLE monsieurbiz_order_history_event ADD CONSTRAINT FK_9EA44E026352511C FOREIGN KEY (admin_user_id) REFERENCES sylius_admin_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters