mirror of
https://github.com/HeyPuter/puter
synced 2024-11-15 06:15:47 +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,
|
`value` text,
|
||||||
|
|
||||||
-- 0016
|
-- 0016
|
||||||
`migrated` tinyint(1) DEFAULT '0'
|
`migrated` tinyint(1) DEFAULT '0',
|
||||||
|
|
||||||
|
-- 0019
|
||||||
|
UNIQUE (user_id, app, kkey_hash)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE `subdomains` (
|
CREATE TABLE `subdomains` (
|
||||||
|
@ -90,8 +90,7 @@ class DBKVStore extends BaseImplementation {
|
|||||||
VALUES (?, ?, ?, ?, ?) ` +
|
VALUES (?, ?, ?, ?, ?) ` +
|
||||||
db.case({
|
db.case({
|
||||||
mysql: 'ON DUPLICATE KEY UPDATE value = ?',
|
mysql: 'ON DUPLICATE KEY UPDATE value = ?',
|
||||||
sqlite: ' ',
|
sqlite: 'ON CONFLICT(user_id, app, kkey_hash) DO UPDATE SET value = excluded.value',
|
||||||
// sqlite: 'ON CONFLICT(user_id, app, kkey_hash) DO UPDATE SET value = ?',
|
|
||||||
}),
|
}),
|
||||||
[
|
[
|
||||||
user.id, app?.uid ?? 'global', key_hash, key, value,
|
user.id, app?.uid ?? 'global', key_hash, key, value,
|
||||||
|
Loading…
Reference in New Issue
Block a user