Upgrade from 8.1.0 to 8.1.6 causing error via 1-Click Upgrade
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the 8.1.0 to 8.1.6 1-Click Upgrade with ps_psgdpr activated, then inspect the prestashop:schema:update-without-foreign failure on ps_psgdpr_consent. Investigate the reported ALTER TABLE statement and verify that the upgrade completes successfully without the auto-column key error.
Written by the indexing model from the issue text.
Description
Prerequisites
- I understand and accept the project's code of conduct.
- I have already searched in existing issues and found no previous report of this bug.
Describe the bug and add attachments
While performing an update via 1-Click Upgrade, I'm getting an error at the end related to ps_psgdpr
Updating database schema...
Executing: ALTER TABLE ps_translation CHANGE key key TEXT NOT NULL COLLATE utf8_bin
Executing: ALTER TABLE ps_authorized_application CHANGE name name VARCHAR(50) NOT NULL
Executing: ALTER TABLE ps_feature_flag CHANGE state state TINYINT(1) DEFAULT '0', CHANGE description_wording description_wording VARCHAR(512) DEFAULT '' NOT NULL
Executing: ALTER TABLE ps_psgdpr_consent_lang MODIFY id_gdpr_consent INT UNSIGNED NOT NULL
Executing: ALTER TABLE ps_psgdpr_consent_lang DROP PRIMARY KEY
Executing: ALTER TABLE ps_psgdpr_consent_lang CHANGE id_gdpr_consent id_gdpr_consent INT NOT NULL, CHANGE id_lang id_lang INT NOT NULL, CHANGE id_shop id_shop INT NOT NULL, CHANGE message message VARCHAR(255) NOT NULL
Executing: CREATE INDEX IDX_9C2246C9BEB78BEF ON ps_psgdpr_consent_lang (id_gdpr_consent)
Executing: CREATE INDEX IDX_9C2246C9BA299860 ON ps_psgdpr_consent_lang (id_lang)
Executing: ALTER TABLE ps_psgdpr_consent_lang ADD PRIMARY KEY (id_gdpr_consent, id_lang)
Executing: DROP INDEX id_customer ON ps_psgdpr_log
Executing: DROP INDEX idx_id_customer ON ps_psgdpr_log
Executing: ALTER TABLE ps_psgdpr_log CHANGE id_gdpr_log id_gdpr_log INT AUTO_INCREMENT NOT NULL, CHANGE id_customer id_customer INT NOT NULL, CHANGE id_guest id_guest INT NOT NULL, CHANGE client_name client_name VARCHAR(255) NOT NULL, CHANGE id_module id_module INT NOT NULL
Executing: ALTER TABLE ps_psgdpr_consent MODIFY id_gdpr_consent INT UNSIGNED NOT NULL
Executing: ALTER TABLE ps_psgdpr_consent DROP PRIMARY KEY
Executing: ALTER TABLE ps_psgdpr_consent CHANGE id_gdpr_consent id_gdpr_consent INT AUTO_INCREMENT NOT NULL, CHANGE id_module id_module INT NOT NULL, CHANGE active active TINYINT(1) NOT NULL, CHANGE error error TINYINT(1) NOT NULL, CHANGE error_message error_message VARCHAR(255) NOT NULL
15:01:56 CRITICAL [console] Error thrown while running command "prestashop:schema:update-without-foreign --env=prod". Message: "An exception occurred while executing 'ALTER TABLE ps_psgdpr_consent CHANGE id_gdpr_consent id_gdpr_consent INT AUTO_INCREMENT NOT NULL, CHANGE id_module id_module INT NOT NULL, CHANGE active active TINYINT(1) NOT NULL, CHANGE error error TINYINT(1) NOT NULL, CHANGE error_message error_message VARCHAR(255) NOT NULL':
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key" ["exception" => Doctrine\DBAL\Exception\DriverException { …},"command" => "prestashop:schema:update-without-foreign --env=prod","message" => """ An exception occurred while executing 'ALTER TABLE ps_psgdpr_consent CHANGE id_gdpr_consent id_gdpr_consent INT AUTO_INCREMENT NOT NULL, CHANGE id_module id_module INT NOT NULL, CHANGE active active TINYINT(1) NOT NULL, CHANGE error error TINYINT(1) NOT NULL, CHANGE error_message error_message VARCHAR(255) NOT NULL':\n \n SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key """]
In AbstractMySQLDriver.php line 128:
An exception occurred while executing 'ALTER TABLE ps_psgdpr_consent CHANGE
id_gdpr_consent id_gdpr_consent INT AUTO_INCREMENT NOT NULL, CHANGE id_mod
ule id_module INT NOT NULL, CHANGE active active TINYINT(1) NOT NULL, CHANG
E error error TINYINT(1) NOT NULL, CHANGE error_message error_message VARCH
AR(255) NOT NULL':
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table def
inition; there can be only one auto column and it must be defined as a key
In Exception.php line 18:
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table def
inition; there can be only one auto column and it must be defined as a key
In PDOConnection.php line 141:
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table def
inition; there can be only one auto column and it must be defined as a key
prestashop:schema:update-without-foreign [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--id_shop [ID_SHOP]] [--id_shop_group [ID_SHOP_GROUP]] [--]
Expected behavior
To successfully upgrade the ps from 8.1.0 to 8.1.6
Steps to reproduce
Install 8.1.0 version
Make sure you have the ps_psgdpr module activated.
Perform an update through 1-Click Upgrade from 8.1.0 to 8.1.6
PrestaShop version(s) where the bug happened
8.1.0
PHP version(s) where the bug happened
7.4
If your bug is related to a module, specify its name and its version
ps_psgdpr
Your company or customer's name goes here (if applicable).
No response
- Dominant language
- JavaScript
- Stars
- 34
- Forks
- 77
- Avg merge
- 12h 50m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PrestaShop/psgdpr
-
[BUG] Deprecated: sha1(): Passing null to parameter #1 ($string) of type string is deprecated in psgdpr/psgdpr.php on line 701Possibly taken @boo-code claimed this 66 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PrestaShop/psgdpr#239 · 5 comments ·
-
[BUG] PHP Deprecated: sha1(): Passing null to parameter #1 ($string) of type string is deprecatedPossibly taken @boo-code claimed this 66 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
PrestaShop/psgdpr#236 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
PrestaShop/psgdpr#263 · 2 comments ·
-
A failed customer search offers the email erasure, which logs a deletion without deleting the customer accountPossibly taken @mattgoud claimed this 17 days ago. Open
PrestaShop/psgdpr#261 · 1 reaction · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
PrestaShop/psgdpr#260 ·
All issues in PrestaShop/psgdpr
Similar issues
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
0xPolygon/polygon-token-list#851 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cline/mcp-marketplace#4171 ·
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Add a languageOpengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100