refactor: manage instance ID in the KV table (#1579)

This commit is contained in:
Alessandro (Ale) Segala
2026-07-11 16:16:05 +02:00
committed by GitHub
parent ff8e34cccf
commit cfda5f693b
37 changed files with 672 additions and 247 deletions
@@ -0,0 +1,14 @@
PRAGMA foreign_keys=OFF;
BEGIN;
-- Move the instance ID back into the standalone app config table
INSERT INTO app_config_variables ("key", "value")
SELECT 'instanceId', "value"
FROM kv
WHERE "key" = 'instance_id' AND "value" IS NOT NULL
ON CONFLICT ("key") DO NOTHING;
DELETE FROM kv WHERE "key" = 'instance_id';
COMMIT;
PRAGMA foreign_keys=ON;
@@ -0,0 +1,14 @@
PRAGMA foreign_keys=OFF;
BEGIN;
-- Move the instance ID out of the standalone app config table and into the "kv" table
INSERT INTO kv ("key", "value")
SELECT 'instance_id', "value"
FROM app_config_variables
WHERE "key" = 'instanceId'
ON CONFLICT ("key") DO NOTHING;
DELETE FROM app_config_variables WHERE "key" = 'instanceId';
COMMIT;
PRAGMA foreign_keys=ON;