From e01b30c70f0223ff9aafa33b7009878b1312e6cc Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Tue, 27 Oct 2009 15:12:14 +0000 Subject: [PATCH] let there be referential integrity Signed-off-by: Mark Hymers --- dak/dakdb/update15.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dak/dakdb/update15.py b/dak/dakdb/update15.py index 10812226..535f9e67 100644 --- a/dak/dakdb/update15.py +++ b/dak/dakdb/update15.py @@ -43,7 +43,7 @@ def do_update(self): CREATE TABLE src_format ( id SERIAL PRIMARY KEY, format_name TEXT NOT NULL, - unique (format_name) + UNIQUE (format_name) ) """) c.execute("INSERT INTO src_format (format_name) VALUES('1.0')") @@ -52,9 +52,9 @@ def do_update(self): c.execute(""" CREATE TABLE suite_src_formats ( - suite INT4 NOT NULL, - src_format INT4 NOT NULL, - unique (suite, src_format) + suite INT4 NOT NULL REFERENCES suite(id), + src_format INT4 NOT NULL REFERENCES src_format(id), + PRIMARY KEY (suite, src_format) ) """) -- 2.39.5