fix(data_import): only convert link values to lowercase for mariadb
We use a case-insensitive collation there, but PostgreSQL and SQLite are case sensitive Followup to #33196 Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
b74b8f16b7
commit
0322b014c2
1 changed files with 3 additions and 3 deletions
|
|
@ -1035,10 +1035,10 @@ class Column:
|
|||
|
||||
if self.df.fieldtype == "Link":
|
||||
# find all values that dont exist
|
||||
values = list({cstr(v).lower() for v in self.column_values if v})
|
||||
transform = (lambda v: cstr(v).lower()) if frappe.db.db_type == "mariadb" else cstr
|
||||
values = list({transform(v) for v in self.column_values if v})
|
||||
exists = [
|
||||
cstr(d.name).lower()
|
||||
for d in frappe.get_all(self.df.options, filters={"name": ("in", values)})
|
||||
transform(d.name) for d in frappe.get_all(self.df.options, filters={"name": ("in", values)})
|
||||
]
|
||||
not_exists = list(set(values) - set(exists))
|
||||
if not_exists:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue