From 89c1ebf43c579d90568e285dbc29f150a4849357 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Mon, 2 Nov 2020 14:06:06 -0500 Subject: [PATCH] SQL: adding pre-3.6 upgrade script --- Open-ILS/src/sql/Pg/upgrade/pines-pre-3.6-upgrade.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/pines-pre-3.6-upgrade.sql diff --git a/Open-ILS/src/sql/Pg/upgrade/pines-pre-3.6-upgrade.sql b/Open-ILS/src/sql/Pg/upgrade/pines-pre-3.6-upgrade.sql new file mode 100644 index 0000000000..267f97f7a9 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/pines-pre-3.6-upgrade.sql @@ -0,0 +1,13 @@ +begin; + + +-- SELECT COUNT(*), workstation, name FROM actor.workstation_setting +-- GROUP BY 2, 3 HAVING COUNT(*) > 1; + +-- we need to dedupe our workstation settings to prepare for the new index +create table actor.workstation_setting_temp like actor.workstation_setting; +insert into actor.workstation_setting_temp select * from actor.workstation_setting; +truncate actor.workstation_setting; +insert into actor.workstation_setting (select distinct on (workstation, name) id, workstation, name, value from actor.workstation_setting_temp); + +commit; -- 2.11.0