DO $$
BEGIN
- IF evergreen.mangle_data_on_deploy() THEN
+ IF evergreen.insert_on_deploy() THEN
INSERT INTO acq.invoice_item_type (code, blanket, name) VALUES (
'BLA', TRUE, oils_i18n_gettext('BLA', 'Blanket Order', 'aiit', 'name'));
END IF;
--- /dev/null
+-- Deploy kcls-evergreen:insert-on-deploy to pg
+-- requires: KMAIN-1765-reingest-causing-false-browse-headings
+
+BEGIN;
+
+-- Returns true if at least one org unit is in the DB.
+-- This is our indication that deployment scripts should
+-- continue inserting new data. If no org unit is preset,
+-- we assume this is a schema-only deployment.
+CREATE OR REPLACE FUNCTION
+ evergreen.insert_on_deploy() RETURNS BOOLEAN AS $$
+ SELECT EXISTS(SELECT id FROM actor.org_unit LIMIT 1);
+$$ LANGUAGE SQL;
+
+COMMIT;
+++ /dev/null
--- Deploy kcls-evergreen:test-data-mangle to pg
--- requires: KMAIN-1765-reingest-causing-false-browse-headings
-
-BEGIN;
-
--- Teturns true if at least one org unit is in the DB
--- This is our indication that deployment scripts should
--- mangle (insert,update,delete) data.
-CREATE OR REPLACE FUNCTION
- evergreen.mangle_data_on_deploy() RETURNS BOOLEAN AS $$
- SELECT EXISTS(SELECT id FROM actor.org_unit LIMIT 1);
-$$ LANGUAGE SQL;
-
-COMMIT;
--- /dev/null
+-- Revert kcls-evergreen:insert-on-deploy from pg
+
+BEGIN;
+
+DROP FUNCTION evergreen.insert_on_deploy();
+
+COMMIT;
+++ /dev/null
--- Revert kcls-evergreen:test-data-mangle from pg
-
-BEGIN;
-
-DROP FUNCTION evergreen.mangle_data_on_deploy();
-
-COMMIT;
02.collection-hq-items-2.5 [01.2.4.1-2.5.7-upgrade] 2015-08-12T21:42:53Z Joshua (JD) Drake <jd@commandprompt.com> # added
KMAIN-1765-reingest-causing-false-browse-headings [02.collection-hq-items-2.5] 2015-08-12T21:45:43Z Joshua (JD) Drake <jd@commandprompt.com> # added
-test-data-mangle [KMAIN-1765-reingest-causing-false-browse-headings] 2015-08-14T20:36:56Z Bill Erickson <berickxx@gmail.com > # Check for wether to mangle data on deploy
-copy-stat-checkout-ok [test-data-mangle] 2015-08-14T20:47:19Z Bill Erickson <berickxx@gmail.com > # copy_status.checkout_ok flag for Grand Opening
+insert-on-deploy [KMAIN-1765-reingest-causing-false-browse-headings] 2015-08-14T20:36:56Z Bill Erickson <berickxx@gmail.com > # Check for wether to insert data on deploy
+copy-stat-checkout-ok [insert-on-deploy] 2015-08-14T20:47:19Z Bill Erickson <berickxx@gmail.com > # copy_status.checkout_ok flag for Grand Opening
blanket-po [copy-stat-checkout-ok] 2015-08-14T21:03:02Z Bill Erickson <berickxx@gmail.com > # Blanket PO
--- /dev/null
+-- Verify kcls-evergreen:insert-on-deploy on pg
+
+BEGIN;
+
+SELECT has_function_privilege('evergreen.insert_on_deploy()', 'execute');
+
+ROLLBACK;
+++ /dev/null
--- Verify kcls-evergreen:test-data-mangle on pg
-
-BEGIN;
-
-SELECT has_function_privilege('evergreen.mangle_data_on_deploy()', 'execute');
-
-ROLLBACK;