add cloning logic

This commit is contained in:
HRG @ SCExC 2024-06-04 03:01:19 -04:00
parent 365b297397
commit 835c5fdd66
8 changed files with 367 additions and 49 deletions

View file

@ -11,9 +11,12 @@ CREATE TABLE structures (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
user_id INTEGER,
route_prefix TEXT,
cloned_from INTEGER,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(user_id) REFERENCES users(id),
FOREIGN KEY(cloned_from) REFERENCES structures(id),
UNIQUE(name, user_id)
);