-
Notifications
You must be signed in to change notification settings - Fork 118
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
Added SQL commands related to doctrine and remove Doctrine usage #636
Conversation
M0rgan01
commented
Sep 26, 2023
•
edited by Quetzacoalt91
Loading
edited by Quetzacoalt91
Questions | Answers |
---|---|
Description? | Added SQL commands related to doctrine, removing the execution of the command 'doctrine:schema:update' |
Type? | improvement |
BC breaks? | no |
Deprecations? | no |
Fixed ticket? | Fixes PrestaShop/PrestaShop#33874, Fixes PrestaShop/PrestaShop#18113 |
Sponsor company | - |
How to test? | Use https://github.com/PrestaShop/SeamlessUpgradeToolbox/tree/main/autoupgrade-scripts for test versions concerned. The SQL dump must be equivalent to a fresh install |
6d29334
to
6732dd2
Compare
Guys what about this PR? |
6732dd2
to
90190a5
Compare
a251bdb
to
ac1f4e8
Compare
ac1f4e8
to
9199581
Compare
9199581
to
ac25f01
Compare
upgrade/sql/1.7.7.0.sql
Outdated
@@ -312,7 +312,7 @@ ALTER TABLE `PREFIX_connections` CHANGE `http_referer` `http_referer` varchar(25 | |||
ALTER TABLE `PREFIX_product_download` CHANGE `display_filename` `display_filename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL; | |||
|
|||
/* Doctrine update happens too late to update the new enabled field, so we preset everything here */ | |||
ALTER TABLE `PREFIX_tab` ADD enabled TINYINT(1) NOT NULL; | |||
ALTER TABLE `PREFIX_tab` ADD enabled TINYINT(1) NOT NULL, ADD route_name VARCHAR(256) DEFAULT NULL, CHANGE class_name class_name VARCHAR(64) NOT NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually have one change per line, can you please split this one in 3?
ALTER TABLE `PREFIX_tab` ADD enabled TINYINT(1) NOT NULL, ADD route_name VARCHAR(256) DEFAULT NULL, CHANGE class_name class_name VARCHAR(64) NOT NULL; | |
ALTER TABLE `PREFIX_tab` ADD enabled TINYINT(1) NOT NULL; | |
ALTER TABLE `PREFIX_tab` ADD route_name VARCHAR(256) DEFAULT NULL; | |
ALTER TABLE `PREFIX_tab` CHANGE class_name class_name VARCHAR(64) NOT NULL; |
upgrade/sql/1.7.8.0.sql
Outdated
DROP INDEX id_shop ON `PREFIX_shop_url`; | ||
DROP INDEX full_shop_url ON `PREFIX_shop_url`; | ||
DROP INDEX full_shop_url_ssl ON `PREFIX_shop_url`; | ||
ALTER TABLE `PREFIX_shop_url` CHANGE id_shop_url id_shop_url INT AUTO_INCREMENT NOT NULL, CHANGE id_shop id_shop INT NOT NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ALTER TABLE `PREFIX_shop_url` CHANGE id_shop_url id_shop_url INT AUTO_INCREMENT NOT NULL, CHANGE id_shop id_shop INT NOT NULL; | |
ALTER TABLE `PREFIX_shop_url` CHANGE id_shop_url id_shop_url INT AUTO_INCREMENT NOT NULL; | |
ALTER TABLE `PREFIX_shop_url` CHANGE id_shop id_shop INT NOT NULL; |
upgrade/sql/8.0.0.sql
Outdated
ALTER TABLE `PREFIX_feature_flag` | ||
CHANGE label_wording label_wording VARCHAR(512) DEFAULT '' NOT NULL, | ||
CHANGE description_wording description_wording VARCHAR(512) DEFAULT '' NOT NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ALTER TABLE `PREFIX_feature_flag` | |
CHANGE label_wording label_wording VARCHAR(512) DEFAULT '' NOT NULL, | |
CHANGE description_wording description_wording VARCHAR(512) DEFAULT '' NOT NULL; | |
ALTER TABLE `PREFIX_feature_flag` CHANGE label_wording label_wording VARCHAR(512) DEFAULT '' NOT NULL; | |
ALTER TABLE `PREFIX_feature_flag` CHANGE description_wording description_wording VARCHAR(512) DEFAULT '' NOT NULL; |
upgrade/sql/8.1.0.sql
Outdated
scopes LONGTEXT NOT NULL COMMENT '(DC2Type:array)', | ||
INDEX IDX_6E064442D8BFF738 (id_authorized_application), | ||
PRIMARY KEY (id_api_access) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = ENGINE_TYPE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may lead to the same result, but I saw the syntax was different for the other CREATE TABLE
statements.
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = ENGINE_TYPE; | |
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
upgrade/sql/8.1.0.sql
Outdated
description LONGTEXT NOT NULL, | ||
UNIQUE INDEX UNIQ_475B9BA55E237E06 (name), | ||
PRIMARY KEY (id_authorized_application) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = ENGINE_TYPE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may lead to the same result, but I saw the syntax was different for the other CREATE TABLE
statements.
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = ENGINE_TYPE; | |
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
ac25f01
to
8fdf343
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I still think we could bring back Doctinre at some point, but this change now should save a lot of trouble during the upgrades! well done @M0rgan01
2fbe466
to
803c6f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @M0rgan01
Thank you for your PR, I tested it :
From 1.7.0.1 to :
- 1.7.1..0
- 1.7.1.1
- 1.7.2.0
- 1.7.3.0
- 1.7.4.0
- 1.7.6.0
- 1.7.7.0
- 1.7.8.11
From 1.7.5.1 to :
- 8.0.5
- 8.1.5
From 8.0.5 to 9.0.0
Because all seems to be corrected as you said, It's QA ✔️
Thank you