In query.stored query: make from_clause nullable, so that we can
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 29 Mar 2010 19:22:38 +0000 (19:22 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 29 Mar 2010 19:22:38 +0000 (19:22 +0000)
represent UNION, INTERSECT, and EXCEPT queries.

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/0220.schema.query.nullable-from.sql

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16038 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/008.schema.query.sql
Open-ILS/src/sql/Pg/upgrade/0220.schema.query.nullable-from.sql [new file with mode: 0644]

index cb38751..e2f7eb5 100644 (file)
@@ -60,7 +60,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0219'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0220); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index a95dd0e..e8c8b0c 100644 (file)
@@ -34,8 +34,9 @@ CREATE TABLE  query.stored_query (
                                     ( type IN ( 'SELECT', 'UNION', 'INTERSECT', 'EXCEPT' ) ),
        use_all       BOOLEAN        NOT NULL DEFAULT FALSE,
        use_distinct  BOOLEAN        NOT NULL DEFAULT FALSE,
-       from_clause   INT            NOT NULL , --REFERENCES query.from_clause
-       where_clause  INT            , --REFERENCES query.expression
+       from_clause   INT,           --REFERENCES query.from_clause
+                                    --DEFERRABLE INITIALLY DEFERRED,
+       where_clause  INT,           --REFERENCES query.expression
                                     --DEFERRABLE INITIALLY DEFERRED,
        having_clause INT            --REFERENCES query.expression
                                     --DEFERRABLE INITIALLY DEFERRED
diff --git a/Open-ILS/src/sql/Pg/upgrade/0220.schema.query.nullable-from.sql b/Open-ILS/src/sql/Pg/upgrade/0220.schema.query.nullable-from.sql
new file mode 100644 (file)
index 0000000..c12e43f
--- /dev/null
@@ -0,0 +1,9 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0220'); -- Scott McKellar
+
+ALTER TABLE query.stored_query
+       ALTER COLUMN from_clause DROP NOT NULL;
+
+COMMIT;
+