diff options
Diffstat (limited to 'src/schema.sql')
-rw-r--r-- | src/schema.sql | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/schema.sql b/src/schema.sql index a9e4a6a..b84b231 100644 --- a/src/schema.sql +++ b/src/schema.sql @@ -64,6 +64,18 @@ CREATE TABLE Builds ( FOREIGN KEY (evaluation) REFERENCES Evaluations (id) ); +CREATE TABLE Events ( + id INTEGER PRIMARY KEY, + type TEXT NOT NULL, + timestamp INTEGER NOT NULL, + event_json TEXT NOT NULL +); + +CREATE TABLE EventsOutbox ( + event_id INTEGER NOT NULL, + FOREIGN KEY (event_id) REFERENCES Events (id) +); + -- Create indexes to speed up common queries, in particular those -- corresponding to /api/latestbuilds and /api/queue HTTP requests. CREATE INDEX Builds_index ON Builds(job_name, system, status ASC, timestamp ASC, derivation, evaluation, stoptime DESC); |