1 CREATE TABLE IF NOT EXISTS sha256 (
2 id integer PRIMARY KEY AUTOINCREMENT,
5 created real DEFAULT (julianday('now'))
8 CREATE TABLE IF NOT EXISTS system (
9 id integer PRIMARY KEY AUTOINCREMENT,
11 version text NOT NULL,
13 created real DEFAULT (julianday('now')),
17 CREATE TABLE IF NOT EXISTS dep (
18 system_id integer NOT NULL REFERENCES system(id),
19 dep_id integer NOT NULL REFERENCES system(id),
20 PRIMARY KEY (system_id, dep_id)
23 CREATE TABLE IF NOT EXISTS src (
24 sha256_id integer REFERENCES sha256(id),
25 system_id integer UNIQUE REFERENCES system(id)
28 DROP VIEW IF EXISTS system_view;
29 CREATE VIEW IF NOT EXISTS system_view AS
36 group_concat((SELECT name FROM system WHERE id = dep.dep_id)) as deps
38 JOIN src ON src.system_id = sys.id
39 JOIN sha256 sha ON sha.id = src.sha256_id
40 LEFT JOIN dep ON dep.system_id = sys.id