aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/sqlite
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-04 13:33:03 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-04 13:33:03 +0200
commit4e79417cc52c35e15c7b30c3d5252aeaabc0b4ec (patch)
tree558bef57ccf2e1562dcd2a91270a6121317ccb41 /src/sqlite
parentworkflows/ci: comment on Valgrind tests (diff)
downloadcimple-4e79417cc52c35e15c7b30c3d5252aeaabc0b4ec.tar.gz
cimple-4e79417cc52c35e15c7b30c3d5252aeaabc0b4ec.zip
sqlite: add run status field
Diffstat (limited to 'src/sqlite')
-rw-r--r--src/sqlite/v01.sql13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sqlite/v01.sql b/src/sqlite/v01.sql
index 88bbc61..2793b8b 100644
--- a/src/sqlite/v01.sql
+++ b/src/sqlite/v01.sql
@@ -5,13 +5,26 @@ CREATE TABLE cimple_repositories (
CREATE UNIQUE INDEX cimple_repositories_url_index ON cimple_repositories(url);
+CREATE TABLE cimple_run_status (
+ id INTEGER PRIMARY KEY,
+ label TEXT NOT NULL
+) STRICT;
+
+CREATE UNIQUE INDEX cimple_run_status_label_index ON cimple_run_status(label);
+
+INSERT INTO cimple_run_status(id, label) VALUES (0, 'created');
+INSERT INTO cimple_run_status(id, label) VALUES (1, 'finished');
+
CREATE TABLE cimple_runs (
id INTEGER PRIMARY KEY,
+ status INTEGER NOT NULL,
result INTEGER NOT NULL,
output BLOB NOT NULL,
repo_id INTEGER NOT NULL,
+ FOREIGN KEY (status) REFERENCES cimple_run_status(id),
FOREIGN KEY (repo_id) REFERENCES cimple_repositories(id)
ON DELETE CASCADE ON UPDATE CASCADE
) STRICT;
+CREATE INDEX cimple_runs_status_index ON cimple_runs(status);
CREATE INDEX cimple_runs_repo_id_index ON cimple_runs(repo_id);