8000 fix(mariadb): set collation in connection (backport #31523) by mergify[bot] · Pull Request #31766 · frappe/frappe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(mariadb): set collation in connection (backport #31523) #31766

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

Merged
merged 2 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frappe/database/mariadb/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def get_connection_settings(self) -> dict:
"user": self.user,
"conv": self.CONVERSION_MAP,
"charset": "utf8mb4",
"collation": "utf8mb4_unicode_ci",
"use_unicode": True,
}

Expand Down Expand Up @@ -321,7 +322,7 @@ def create_user_settings_table(self):
`doctype` VARCHAR(180) NOT NULL,
`data` TEXT,
UNIQUE(user, doctype)
) ENGINE=InnoDB DEFAULT CHARSET=utf8"""
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"""
)

@staticmethod
Expand Down
1 change: 1 addition & 0 deletions frappe/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,4 @@ frappe.integrations.doctype.oauth_client.patches.set_default_allowed_role_in_oau
frappe.patches.v16_0.add_app_launcher_in_navbar_settings
frappe.patches.v15_0.remove_workspace_settings_navbar_items
frappe.patches.v16_0.move_role_desk_settings_to_user
frappe.patches.v14_0.fix_user_settings_collation
5 changes: 5 additions & 0 deletions frappe/patches/v14_0/fix_user_settings_collation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import frappe


def execute():
frappe.db.sql("ALTER TABLE __UserSettings CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;")
0