X-Git-Url: https://git.evergreen-ils.org/?p=working%2FEvergreen.git;a=blobdiff_plain;f=Open-ILS%2Fsrc%2Fsql%2FPg%2F008.schema.query.sql;h=7f489a0972fdd75af39ef2d80adbf9e9780ef5a8;hp=8c511f4e67355bbc106fdcda8dc85985ad123626;hb=42091320eb3bd0dfcf0b2cadba50f059b2842306;hpb=9c81053a6aa3982025f737850dcc595a7f598ad5 diff --git a/Open-ILS/src/sql/Pg/008.schema.query.sql b/Open-ILS/src/sql/Pg/008.schema.query.sql index 8c511f4e67..7f489a0972 100644 --- a/Open-ILS/src/sql/Pg/008.schema.query.sql +++ b/Open-ILS/src/sql/Pg/008.schema.query.sql @@ -39,9 +39,11 @@ CREATE TABLE query.stored_query ( where_clause INT, --REFERENCES query.expression --DEFERRABLE INITIALLY DEFERRED, having_clause INT, --REFERENCES query.expression + --DEFERRABLE INITIALLY DEFERRED, + limit_count INT, --REFERENCES query.expression + --DEFERRABLE INITIALLY DEFERRED, + offset_count INT --REFERENCES query.expression --DEFERRABLE INITIALLY DEFERRED - limit_count INT, - offset_count INT ); -- (Foreign keys to be defined later after other tables are created) @@ -188,6 +190,16 @@ ALTER TABLE query.stored_query REFERENCES query.expression( id ) DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE query.stored_query + ADD FOREIGN KEY ( limit_count ) + REFERENCES query.expression( id ) + DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE query.stored_query + ADD FOREIGN KEY ( offset_count ) + REFERENCES query.expression( id ) + DEFERRABLE INITIALLY DEFERRED; + CREATE TABLE query.case_branch ( id SERIAL PRIMARY KEY, parent_expr INT NOT NULL REFERENCES query.expression