first implementation of document strategy

This commit is contained in:
venture
2026-11-13 21:11:28 +01:00
parent fdb52d1cfe
commit 4da2fe9424
19 changed files with 1403 additions and 284 deletions
+48
View File
@@ -0,0 +1,48 @@
-- +goose Up
-- Identifiants fixes et connus pour les comptes système (pas des UUIDv7, volontairement).
-- Le principal de type 'cluster' est créé à l'installation, avec la clé racine générée.
INSERT INTO principal (id, kind, name, created_at) VALUES
(x'00000000000070008000000000000001', 'system', 'system', CAST(strftime('%s','now') AS INTEGER) * 1000),
(x'00000000000070008000000000000002', 'group', 'admins', CAST(strftime('%s','now') AS INTEGER) * 1000),
(x'00000000000070008000000000000003', 'group', 'members', CAST(strftime('%s','now') AS INTEGER) * 1000),
(x'00000000000070008000000000000004', 'group', 'guests', CAST(strftime('%s','now') AS INTEGER) * 1000);
INSERT INTO document_kind (kind, provider, has_content, hidden) VALUES
('library', 'core', 0, 0),
('folder', 'core', 0, 0),
('movie', 'core', 0, 0),
('series', 'core', 0, 0),
('season', 'core', 0, 0),
('video', 'core', 1, 0),
('subtitle', 'core', 1, 0),
('image', 'core', 1, 0),
('file', 'core', 1, 0),
('computed/media-probe','core', 1, 1);
INSERT INTO storage_policy (id, name, mode, min_remote_replicas, created_at) VALUES
(x'00000000000070008000000000000101', 'cloud', 'cloud', 0, CAST(strftime('%s','now') AS INTEGER) * 1000),
(x'00000000000070008000000000000102', 'sync', 'sync', 0, CAST(strftime('%s','now') AS INTEGER) * 1000);
-- +goose Down
PRAGMA defer_foreign_keys = ON;
DELETE FROM storage_policy
WHERE id IN (
x'00000000000070008000000000000101',
x'00000000000070008000000000000102'
);
DELETE FROM document_kind
WHERE kind IN (
'library', 'folder', 'movie', 'series', 'season',
'video', 'subtitle', 'image', 'file', 'computed/media-probe'
);
DELETE FROM principal
WHERE id IN (
x'00000000000070008000000000000001',
x'00000000000070008000000000000002',
x'00000000000070008000000000000003',
x'00000000000070008000000000000004'
);