From 85a879fef5966313befaf9f13cdb61c1bb38c215 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Wed, 18 Jul 2012 10:50:00 +0200
Subject: [PATCH] sql repariert

---
 hsarback/database/database_update.sql |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/hsarback/database/database_update.sql b/hsarback/database/database_update.sql
index e6fb286..9d462ec 100644
--- a/hsarback/database/database_update.sql
+++ b/hsarback/database/database_update.sql
@@ -9,11 +9,16 @@
     domain_option_name character varying(50) NOT NULL
 );
 
+ALTER TABLE ONLY domain_option
+    ADD CONSTRAINT domain_option_uniq UNIQUE (domain_option_id);
+
 CREATE TABLE domain__domain_option (
-	domain_option_id integer NOT NULL;
-	domain_id integer NOT NULL;
+	domain_option_id integer NOT NULL,
+	domain_id integer NOT NULL
 ); 
 
+CREATE UNIQUE INDEX unique_domain__domain_option ON domain__domain_option USING btree (domain_option_id, domain_id);
+
 ALTER TABLE ONLY domain__domain_option
     ADD CONSTRAINT domain_option_id_fkey FOREIGN KEY (domain_option_id) 
     	REFERENCES domain_option(domain_option_id) DEFERRABLE;

--
Gitblit v1.9.1