From 89be2c4816ccbd489743b41256445e6549928932 Mon Sep 17 00:00:00 2001 From: restitux Date: Thu, 4 May 2023 20:15:37 -0600 Subject: [PATCH] Correct primary key on pipeline_refs table --- database/db.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/database/db.go b/database/db.go index 6b29c2a..4a713f9 100644 --- a/database/db.go +++ b/database/db.go @@ -181,10 +181,12 @@ CREATE TABLE runners ( ); CREATE TABLE pipeline_refs ( - name TEXT PRIMARY KEY NOT NULL, + name TEXT NOT NULL, pipeline_id UUID NOT NULL, hash TEXT NOT NULL, + PRIMARY KEY(name, pipeline_id), + CONSTRAINT fk_pipeline_id FOREIGN KEY(pipeline_id) REFERENCES pipelines(id)