[open-ils-commits] r13926 - trunk/Open-ILS/src/sql/Pg (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Aug 24 13:49:30 EDT 2009
Author: scottmk
Date: 2009-08-24 13:49:26 -0400 (Mon, 24 Aug 2009)
New Revision: 13926
Modified:
trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
Log:
Change constraint on acq.provider. Instead of making code unique
by itself, make code + owner unique.
To change an existing table:
ALTER TABLE acq.provider
DROP CONSTRAINT provider_code_key;
ALTER TABLE acq.provider
ALTER COLUMN code SET NOT NULL;
ALTER TABLE acq.provider
ADD CONSTRAINT code_once_per_owner
UNIQUE (code, owner);
Modified: trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2009-08-24 16:24:02 UTC (rev 13925)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2009-08-24 17:49:26 UTC (rev 13926)
@@ -34,9 +34,10 @@
name TEXT NOT NULL,
owner INT NOT NULL REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED,
currency_type TEXT NOT NULL REFERENCES acq.currency_type (code) DEFERRABLE INITIALLY DEFERRED,
- code TEXT UNIQUE,
+ code TEXT NOT NULL,
holding_tag TEXT,
- CONSTRAINT provider_name_once_per_owner UNIQUE (name,owner)
+ CONSTRAINT provider_name_once_per_owner UNIQUE (name,owner),
+ CONSTRAINT code_once_per_owner UNIQUE (code, owner)
);
CREATE TABLE acq.provider_holding_subfield_map (
More information about the open-ils-commits
mailing list