aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/sqlite
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-08 00:54:26 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-08 01:33:00 +0200
commit52fd7a89473c4b7e18862a5c1f9a2b6715cc41c4 (patch)
treec823138a799d80763ee801c77f6185695f754839 /src/sqlite
parentclang-format: don't break string literals (diff)
downloadcimple-52fd7a89473c4b7e18862a5c1f9a2b6715cc41c4.tar.gz
cimple-52fd7a89473c4b7e18862a5c1f9a2b6715cc41c4.zip
test: verify that added runs are in the database
And that they're marked as finished. It immediately exposed some concurrency bugs, so some locking has been fixed.
Diffstat (limited to '')
-rw-r--r--src/sqlite/v01.sql6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sqlite/v01.sql b/src/sqlite/v01.sql
index 454c19e..b37e486 100644
--- a/src/sqlite/v01.sql
+++ b/src/sqlite/v01.sql
@@ -29,3 +29,9 @@ CREATE TABLE cimple_runs (
CREATE INDEX cimple_runs_index_status ON cimple_runs(status);
CREATE INDEX cimple_runs_index_repo_id ON cimple_runs(repo_id);
+
+CREATE VIEW cimple_runs_readable AS
+ SELECT run.id, status.label, run.ec, run.output, repo.url, run.rev
+ FROM cimple_runs AS run
+ INNER JOIN cimple_run_status as status ON run.status = status.id
+ INNER JOIN cimple_repos as repo ON run.repo_id = repo.id;