[open-ils-commits] r16413 - in trunk/Open-ILS: examples src/sql/Pg src/sql/Pg/upgrade (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon May 10 14:42:56 EDT 2010
Author: scottmk
Date: 2010-05-10 14:42:52 -0400 (Mon, 10 May 2010)
New Revision: 16413
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0255.query-expr-bind.sql
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/008.schema.query.sql
Log:
Add to query.expression: foreign key bind_variable pointing
to query.bind_variable. Also: allow the expression type 'xbind'.
M Open-ILS/src/sql/Pg/002.schema.config.sql
M Open-ILS/src/sql/Pg/008.schema.query.sql
A Open-ILS/src/sql/Pg/upgrade/0255.query-expr-bind.sql
M Open-ILS/examples/fm_IDL.xml
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-05-10 18:37:44 UTC (rev 16412)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-05-10 18:42:52 UTC (rev 16413)
@@ -6608,6 +6608,7 @@
<field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
<field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
<field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
+ <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
</fields>
<links>
<link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
@@ -6616,6 +6617,7 @@
<link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
<link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
<link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
+ <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
</permacrud>
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-05-10 18:37:44 UTC (rev 16412)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-05-10 18:42:52 UTC (rev 16413)
@@ -65,7 +65,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0254'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0255'); -- Scott McKellar
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/008.schema.query.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/008.schema.query.sql 2010-05-10 18:37:44 UTC (rev 16412)
+++ trunk/Open-ILS/src/sql/Pg/008.schema.query.sql 2010-05-10 18:42:52 UTC (rev 16413)
@@ -121,9 +121,10 @@
CREATE TABLE query.expression (
id SERIAL PRIMARY KEY,
- type TEXT NOT NULL CONSTRAINT predicate_type CHECK
+ type TEXT NOT NULL CONSTRAINT expression_type CHECK
( type IN (
'xbet', -- between
+ 'xbind', -- bind variable
'xbool', -- boolean
'xcase', -- case
'xcast', -- cast
@@ -157,7 +158,9 @@
DEFERRABLE INITIALLY DEFERRED,
cast_type INT REFERENCES query.datatype
DEFERRABLE INITIALLY DEFERRED,
- negate BOOL NOT NULL DEFAULT FALSE
+ negate BOOL NOT NULL DEFAULT FALSE,
+ bind_variable TEXT REFERENCES query.bind_variable
+ DEFERRABLE INITIALLY DEFERRED
);
CREATE UNIQUE INDEX query_expr_parent_seq
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0255.query-expr-bind.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0255.query-expr-bind.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0255.query-expr-bind.sql 2010-05-10 18:42:52 UTC (rev 16413)
@@ -0,0 +1,33 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0255'); -- Scott McKellar
+
+ALTER TABLE query.expression
+ ADD CONSTRAINT expression_type CHECK
+ ( type IN (
+ 'xbet',
+ 'xbind',
+ 'xbool',
+ 'xcase',
+ 'xcast',
+ 'xcol',
+ 'xex',
+ 'xfld',
+ 'xfunc',
+ 'xin',
+ 'xnull',
+ 'xnum',
+ 'xop',
+ 'xstr',
+ 'xsubq'
+));
+
+ALTER TABLE query.expression
+ DROP CONSTRAINT predicate_type;
+
+ALTER TABLE query.expression
+ ADD COLUMN bind_variable TEXT
+ REFERENCES query.bind_variable
+ DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;
More information about the open-ils-commits
mailing list