mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
Merge pull request #280 from vineeth-vk11/#206
fixing on conflict issue in sqlite kv write
This commit is contained in:
commit
e4f2c4a28b
@ -120,7 +120,10 @@ CREATE TABLE `kv` (
|
||||
`value` text,
|
||||
|
||||
-- 0016
|
||||
`migrated` tinyint(1) DEFAULT '0'
|
||||
`migrated` tinyint(1) DEFAULT '0',
|
||||
|
||||
-- 0019
|
||||
UNIQUE (user_id, app, kkey_hash)
|
||||
);
|
||||
|
||||
CREATE TABLE `subdomains` (
|
||||
|
@ -90,8 +90,7 @@ class DBKVStore extends BaseImplementation {
|
||||
VALUES (?, ?, ?, ?, ?) ` +
|
||||
db.case({
|
||||
mysql: 'ON DUPLICATE KEY UPDATE value = ?',
|
||||
sqlite: ' ',
|
||||
// sqlite: 'ON CONFLICT(user_id, app, kkey_hash) DO UPDATE SET value = ?',
|
||||
sqlite: 'ON CONFLICT(user_id, app, kkey_hash) DO UPDATE SET value = excluded.value',
|
||||
}),
|
||||
[
|
||||
user.id, app?.uid ?? 'global', key_hash, key, value,
|
||||
|
Loading…
Reference in New Issue
Block a user