Improve closed branch experience
- expose closing-related properties for editing in TK
- sibyl: fetch branches on startup, and use it to remove aggregations for branches where hideHoldings is true
- proxy: fetch branches on startup, and use it to ignore holdings for branches where hideHoldings is true
- rename properties to match actual use: closed => hideHoldings, active => isPickupBranch
euler2 sql migrations:
CREATE TABLE tmp_library (
id TEXT PRIMARY KEY,
name TEXT NOT NULL GENERATED ALWAYS AS (json_extract(data, '$.name')) STORED,
data JSON NOT NULL DEFAULT '{}',
created_by TEXT NOT NULL REFERENCES editor (id),
updated_by TEXT NOT NULL REFERENCES editor (id),
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
archived_at DATETIME
);
INSERT INTO tmp_library (id, data, created_by, updated_by, created_at, updated_at, archived_at)
SELECT id, data, created_by, updated_by, created_at, updated_at, archived_at FROM library;
DROP TABLE library;
ALTER TABLE tmp_library RENAME TO library;
UPDATE library SET data=json_set(data,
'$.hideHoldings', json_extract(data, '$.closed'),
'$.isPickupBranch', json_extract(data, '$.active'));
UPDATE library SET data=json_remove(data,
'$.closed',
'$.active');
Edited by Petter Goksøyr Åsen