8000 `RememberMeMigration` creates `rememberme_token` table without configured charset & collation · Issue #7985 · contao/contao · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

RememberMeMigration creates rememberme_token table without configured charset & collation #7985

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

Closed
8000
fritzmg opened this issue Jan 30, 2025 · 0 comments · Fixed by #8165
Closed
Labels
Milestone

Comments

@fritzmg
Copy link
Contributor
fritzmg commented Jan 30, 2025

Affected version(s)

5.3+

Description

Our RememberMeMigration currently creates the rememberme_token table without a collation:

CREATE TABLE `rememberme_token` (
`series` varchar(88) UNIQUE PRIMARY KEY NOT NULL,
`value` varchar(88) NOT NULL,
`lastUsed` datetime NOT NULL COMMENT '(DC2Type:datetime_immutable)',
`class` varchar(100) NOT NULL,
`username` varchar(200) NOT NULL
);

Meaning that whatever default collation is configured on the current MySQL server will be used instead. This can create issues - for example if you want to restore a database backup on another system where that specific default collation of the source system is not available:

$ bin/console c:b:r


 [ERROR] An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1273 Unknown collation:                 
         'utf8mb4_uca1400_ai_ci'  

Our CREATE TABLE statement should instead include the configured default charset and collation for the current database connection, to keep the table consistent with all the others.

In a fresh Contao 5.3+ installation (i.e. when not migrating from Contao 4.13) the rememberme_token table will be created correctly with the configured charset and collation.

@fritzmg fritzmg added this to the 5.3 milestone Jan 30, 2025
@leofeyer leofeyer linked a pull request Mar 4, 2025 that will close this issue
@leofeyer leofeyer closed this as completed Mar 4, 2025
leofeyer added a commit that referenced this issue Mar 5, 2025
Description
-----------

Fixes #7985

Commits
-------

86835cf Check the default table options in the `RememberMeMigration`
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0