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

SF.net SVN: ledger-smb:[3763] branches/1.3/sql



Revision: 3763
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3763&view=rev
Author:   einhverfr
Date:     2011-09-27 21:16:39 +0000 (Tue, 27 Sep 2011)
Log Message:
-----------
ensuring that entity.control_code is unique.

Modified Paths:
--------------
    branches/1.3/sql/Pg-database.sql

Added Paths:
-----------
    branches/1.3/sql/upgrade/3751-control_code_index.sql

Modified: branches/1.3/sql/Pg-database.sql
===================================================================
--- branches/1.3/sql/Pg-database.sql	2011-09-27 17:30:11 UTC (rev 3762)
+++ branches/1.3/sql/Pg-database.sql	2011-09-27 21:16:39 UTC (rev 3763)
@@ -431,7 +431,7 @@
   name text check (name ~ '[[:alnum:]_]'),
   entity_class integer references entity_class(id) not null ,
   created date not null default current_date,
-  control_code text,
+  control_code text unique,
   country_id int references country(id) not null,
   PRIMARY KEY(control_code, entity_class));
   

Added: branches/1.3/sql/upgrade/3751-control_code_index.sql
===================================================================
--- branches/1.3/sql/upgrade/3751-control_code_index.sql	                        (rev 0)
+++ branches/1.3/sql/upgrade/3751-control_code_index.sql	2011-09-27 21:16:39 UTC (rev 3763)
@@ -0,0 +1 @@
+ALTER TABLE entity ADD UNIQUE (control_code);

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.