Skip to content

Commit

Permalink
Merge pull request #441 from jolelievre/unit-price-ratio
Browse files Browse the repository at this point in the history
Add SQL upgrade queries for new unit price column
  • Loading branch information
atomiix authored Jul 5, 2022
2 parents afa5211 + 2ae16e5 commit b830a97
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions upgrade/sql/8.0.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ ALTER TABLE `PREFIX_product_shop` MODIFY COLUMN `redirect_type` ENUM(

ALTER TABLE `PREFIX_order_detail` MODIFY COLUMN `product_name` TEXT NOT NULL;

ALTER TABLE `PREFIX_product` ADD `unit_price` decimal(20, 6) NOT NULL DEFAULT '0.000000' AFTER `unity`;
ALTER TABLE `PREFIX_product_shop` ADD `unit_price` decimal(20, 6) NOT NULL DEFAULT '0.000000' AFTER `unity`;

UPDATE `PREFIX_product` SET `unit_price` = IF (`unit_price_ratio` != 0, `price` / `unit_price_ratio`, 0);
UPDATE `PREFIX_product_shop` SET `unit_price` = IF (`unit_price_ratio` != 0, `price` / `unit_price_ratio`, 0);


ALTER TABLE `PREFIX_feature_flag` ADD `stability` VARCHAR(64) DEFAULT 'beta' NOT NULL;
UPDATE `PREFIX_feature_flag` SET `state` = '0', `stability` = 'stable', `label_wording` = 'New product page - Single store', `description_wording` = 'This page benefits from increased performance and includes new features such as a new combination management system.' WHERE `name` = 'product_page_V2';

Expand Down

0 comments on commit b830a97

Please sign in to comment.