Skip to content

Fix Userprofile.username charset db inconsistency #1812

@eviljeff

Description

@eviljeff

Running migration 1201 resulted in the error stderr: b"ERROR 1062 (23000) at line 2: Duplicate entry 'Austin' for key 'username'\n seemingly because we are dropping the existing explicit column definition of CHARACTER SET utf8mb4 COLLATE utf8mb4_bin and replacing it with the table default.

Attempts to manually fix the data by renaming the "Austin" username to something else, resulted in a different error for the next username, and so on (I abandoned after 3 UPDATE to different records). To unblock the stage deploy I merged mozilla/addons-server@d6cdd59 and cherry-picked to the https://github.com/mozilla/addons-server/tree/2019.09.19-1 tag.

We need to fix the inconsistency and reapply ALTER TABLE `users` CHANGE COLUMN `username` `username` VARCHAR (255) NOT NULL; to bring the stage&prod database to django norms.

┆Issue is synchronized with this Jira Task

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions