[open-ils-commits] r13927 - branches/rel_1_6/Open-ILS/src/sql/Pg (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Aug 24 13:53:18 EDT 2009
Author: scottmk
Date: 2009-08-24 13:53:14 -0400 (Mon, 24 Aug 2009)
New Revision: 13927
Modified:
branches/rel_1_6/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.
For changing 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: branches/rel_1_6/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- branches/rel_1_6/Open-ILS/src/sql/Pg/200.schema.acq.sql 2009-08-24 17:49:26 UTC (rev 13926)
+++ branches/rel_1_6/Open-ILS/src/sql/Pg/200.schema.acq.sql 2009-08-24 17:53:14 UTC (rev 13927)
@@ -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