From 27c99fd90ad41db1396a9aff71bc3e1829f0d367 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Thu, 4 Apr 2024 20:02:35 -0400 Subject: [PATCH] Use OR IGNORE when sqlite --- packages/backend/src/om/entitystorage/AppES.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/om/entitystorage/AppES.js b/packages/backend/src/om/entitystorage/AppES.js index 8af6158a..671d927a 100644 --- a/packages/backend/src/om/entitystorage/AppES.js +++ b/packages/backend/src/om/entitystorage/AppES.js @@ -187,7 +187,10 @@ class AppES extends BaseES { const subdomain = await entity.get('subdomain'); const user = Context.get('user'); let subdomain_res = await this.db.write( - `INSERT IGNORE INTO subdomains + `INSERT ${this.db.case({ + mysql: 'IGNORE', + sqlite: 'OR IGNORE', + })} INTO subdomains (subdomain, user_id, root_dir_id, uuid) VALUES ( ?, ?, ?, ?)`, [