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
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16413
dcc99617-32d9-48b4-a31d-
7c20da2025e4
<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"/>
<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>
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,
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
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
--- /dev/null
+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;