-
Notifications
You must be signed in to change notification settings - Fork 4
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 #36 from Gedeelde-Weelde/bug/GED-64-product-withou…
…t-plu-code Bug/ged 64 product without plu code
- Loading branch information
Showing
4 changed files
with
66 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import logging | ||
|
||
# ruff: noqa | ||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
def migrate(cr, version): | ||
_logger.info("Removing sql constraint shop_plucode_uniq") | ||
# Safely drop the SQL constraint if it exists | ||
cr.execute( | ||
""" | ||
DO $$ BEGIN | ||
IF EXISTS ( | ||
SELECT 1 | ||
FROM information_schema.table_constraints | ||
WHERE constraint_name = 'product_template_shop_plucode_uniq' | ||
AND table_name = 'product_template' | ||
) THEN | ||
ALTER TABLE product_template DROP CONSTRAINT product_template_shop_plucode_uniq; | ||
END IF; | ||
END $$; | ||
""" | ||
) |
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