Fixing a typo in the previous changeset (a missing comma that led to
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 21 May 2010 13:04:16 +0000 (13:04 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 21 May 2010 13:04:16 +0000 (13:04 +0000)
nonsense instead of an obvious error).

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/0270.schema.query-xisnull-correction.sql

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16469 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/0270.schema.query-xisnull-correction.sql [new file with mode: 0644]

index 2e1cdd6..970af18 100644 (file)
@@ -65,7 +65,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0269'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0270'); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index 5c62714..dccb1a6 100644 (file)
@@ -134,7 +134,7 @@ CREATE TABLE query.expression (
                                                                        'xfld',    -- field
                                                                        'xfunc',   -- function
                                                                        'xin',     -- in
-                                                                       'xisnull'  -- is null
+                                                                       'xisnull', -- is null
                                        'xnull',   -- null
                                                                        'xnum',    -- number
                                                                        'xop',     -- operator
diff --git a/Open-ILS/src/sql/Pg/upgrade/0270.schema.query-xisnull-correction.sql b/Open-ILS/src/sql/Pg/upgrade/0270.schema.query-xisnull-correction.sql
new file mode 100644 (file)
index 0000000..4bb11d9
--- /dev/null
@@ -0,0 +1,31 @@
+BEGIN;
+
+-- Create new expression type for IS [NOT] NULL
+
+INSERT INTO config.upgrade_log (version) VALUES ('0270'); -- Scott McKellar
+
+ALTER TABLE query.expression
+       DROP CONSTRAINT expression_type;
+
+ALTER TABLE query.expression
+       ADD CONSTRAINT expression_type CHECK
+    ( type IN (
+               'xbet',    -- between
+               'xbind',   -- bind variable
+               'xbool',   -- boolean
+               'xcase',   -- case
+               'xcast',   -- cast
+               'xcol',    -- column
+               'xex',     -- exists
+               'xfld',    -- field
+               'xfunc',   -- function
+               'xin',     -- in
+               'xisnull', -- is null
+               'xnull',   -- null
+               'xnum',    -- number
+               'xop',     -- operator
+               'xstr',    -- string
+               'xsubq'    -- subquery
+       ) );
+
+COMMIT;