[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] let there be referential integrity



Signed-off-by: Mark Hymers <mhy@debian.org>
---
 dak/dakdb/update15.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dak/dakdb/update15.py b/dak/dakdb/update15.py
index 1081222..535f9e6 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)
             )
         """)
 
-- 
1.6.3.3


Reply to: