From 50548d460c485166407ccad760f577990fdf1a73 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Thu, 12 Jan 2012 17:47:26 -0500 Subject: [PATCH] adding count_dupes.py to repo; moving _replication schema drop to earlier in the process --- Open-ILS/src/sql/Pg/count_dupes.py | 24 ++++++++++++++++++++++ .../src/sql/Pg/pines-post-1.6.1-2.1-upgrade.sql | 2 -- .../src/sql/Pg/pines-pre-1.6.1-2.1-upgrade.sql | 2 ++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 Open-ILS/src/sql/Pg/count_dupes.py diff --git a/Open-ILS/src/sql/Pg/count_dupes.py b/Open-ILS/src/sql/Pg/count_dupes.py new file mode 100755 index 0000000000..0faa1ab792 --- /dev/null +++ b/Open-ILS/src/sql/Pg/count_dupes.py @@ -0,0 +1,24 @@ +#!/usr/bin/python +# +# created by Josh Lamos to pull out the IDs from an SQL result set for +# duplicated authority headings. +# + +import os +f=open('auth-dupes-2011-12-06','ro') +lines=f.readlines() +f.close() +lines[0].split('|') +extra_ids=list() +last_entry="" +for line in lines: + if line.split('|')[0] != last_entry: + last_entry = line.split('|')[0] + else: + extra_ids.append(line.split('|')[1]) +f=open('results.out','w') +for line in extra_ids: + f.write(line) + +f.close() + diff --git a/Open-ILS/src/sql/Pg/pines-post-1.6.1-2.1-upgrade.sql b/Open-ILS/src/sql/Pg/pines-post-1.6.1-2.1-upgrade.sql index 3d85ac624e..28ab55fa5a 100644 --- a/Open-ILS/src/sql/Pg/pines-post-1.6.1-2.1-upgrade.sql +++ b/Open-ILS/src/sql/Pg/pines-post-1.6.1-2.1-upgrade.sql @@ -71,6 +71,4 @@ ALTER TABLE reporter.classic_current_circ GRANT ALL ON TABLE reporter.classic_current_circ TO postgres; GRANT SELECT, REFERENCES, TRIGGER ON TABLE reporter.classic_current_circ TO public; --- drop the replication tables to allow us to create a new slony node -DROP SCHEMA _replication CASCADE; diff --git a/Open-ILS/src/sql/Pg/pines-pre-1.6.1-2.1-upgrade.sql b/Open-ILS/src/sql/Pg/pines-pre-1.6.1-2.1-upgrade.sql index 11aee7c846..f6c741d3fd 100644 --- a/Open-ILS/src/sql/Pg/pines-pre-1.6.1-2.1-upgrade.sql +++ b/Open-ILS/src/sql/Pg/pines-pre-1.6.1-2.1-upgrade.sql @@ -235,4 +235,6 @@ DROP VIEW reporter.classic_current_billing_summary; DROP VIEW reporter.classic_current_circ; +-- drop the replication tables to allow us to create a new slony node +DROP SCHEMA _replication CASCADE; -- 2.11.0