add support for mounting existing dbs by id

This commit is contained in:
HRG @ SCExC 2024-06-04 01:21:32 -04:00
parent 7aac7aabdd
commit 365b297397
3 changed files with 65 additions and 19 deletions

View file

@ -20,7 +20,7 @@ CREATE TABLE structures (
CREATE TABLE dbs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
structure_id INTEGER,
structure_id INTEGER NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
library TEXT NOT NULL DEFAULT "",
@ -75,6 +75,16 @@ CREATE TABLE files (
UNIQUE(path, structure_id)
);
INSERT INTO
structures (id, name, user_id)
VALUES
(0, 'prime', NULL);
INSERT INTO
dbs (id, name, structure_id, library)
VALUES
(0, 'prime', 0, '');
-- ===========================
-- TRIGGERS
-- ===========================