LP1810802 org_top() SQL upgrade repairs
authorBill Erickson <berickxx@gmail.com>
Mon, 7 Jan 2019 15:49:28 +0000 (10:49 -0500)
committerJason Stephenson <jason@sigio.com>
Tue, 8 Jan 2019 16:29:33 +0000 (11:29 -0500)
1. Drop the org_top function before recreating it since the return type
changes.

2. Fis syntax error in "COMMIT:"

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jason Stephenson <jason@sigio.com>
Open-ILS/src/sql/Pg/upgrade/1140.function.non-set-returning-evergreen.org_top.sql

index c7ff647..105136c 100644 (file)
@@ -2,9 +2,11 @@ BEGIN;
 
 SELECT evergreen.upgrade_deps_block_check('1140', :eg_version);
 
+DROP FUNCTION IF EXISTS evergreen.org_top();
+
 CREATE OR REPLACE FUNCTION evergreen.org_top()
 RETURNS actor.org_unit AS $$
     SELECT * FROM actor.org_unit WHERE parent_ou IS NULL LIMIT 1;
 $$ LANGUAGE SQL STABLE;
 
-COMMIT:
+COMMIT;