From bcb902397123ebf504eee654d9e5552c4e08cc89 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Tue, 17 Dec 2013 10:16:32 -0500 Subject: [PATCH] Move default actor.org_unit entries into sample data The only actor.org_unit entry we absolutely require in the sample data is the consortium, as many things are owned by it. Otherwise, we should treat the libraries and associated settings such as addresses as sample data. Signed-off-by: Dan Scott Signed-off-by: Bill Erickson Signed-off-by: Ben Shum --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 23 +---------------------- Open-ILS/tests/datasets/sql/libraries.sql | 24 ++++++++++++++++++++++++ Open-ILS/tests/datasets/sql/load_all.sql | 3 +++ Open-ILS/tests/datasets/sql/load_concerto.sql | 3 +++ 4 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 Open-ILS/tests/datasets/sql/libraries.sql diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 770443eb24..e0912da2b5 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -452,32 +452,11 @@ INSERT INTO actor.org_unit_type (id, name, opac_label, depth, parent) VALUES oils_i18n_gettext(5, 'Your Bookmobile', 'aout', 'opac_label'), 3, 3 ); SELECT SETVAL('actor.org_unit_type_id_seq'::TEXT, 100); +-- We need one actor.org_unit to own many things INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES (1, NULL, 1, 'CONS', oils_i18n_gettext(1, 'Example Consortium', 'aou', 'name')); -INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES - (2, 1, 2, 'SYS1', oils_i18n_gettext(2, 'Example System 1', 'aou', 'name')); -INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES - (3, 1, 2, 'SYS2', oils_i18n_gettext(3, 'Example System 2', 'aou', 'name')); -INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES - (4, 2, 3, 'BR1', oils_i18n_gettext(4, 'Example Branch 1', 'aou', 'name')); -INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES - (5, 2, 3, 'BR2', oils_i18n_gettext(5, 'Example Branch 2', 'aou', 'name')); -INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES - (6, 3, 3, 'BR3', oils_i18n_gettext(6, 'Example Branch 3', 'aou', 'name')); -INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES - (7, 3, 3, 'BR4', oils_i18n_gettext(7, 'Example Branch 4', 'aou', 'name')); -INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES - (8, 4, 4, 'SL1', oils_i18n_gettext(8, 'Example Sub-library 1', 'aou', 'name')); -INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES - (9, 6, 5, 'BM1', oils_i18n_gettext(9, 'Example Bookmobile 1', 'aou', 'name')); SELECT SETVAL('actor.org_unit_id_seq'::TEXT, 100); -INSERT INTO actor.org_address (org_unit, street1, city, state, country, post_code) -SELECT id, '123 Main St.', 'Anywhere', 'GA', 'US', '30303' -FROM actor.org_unit; - -UPDATE actor.org_unit SET holds_address = id, ill_address = id, billing_address = id, mailing_address = id; - INSERT INTO config.billing_type (id, name, owner) VALUES ( 1, oils_i18n_gettext(1, 'Overdue Materials', 'cbt', 'name'), 1); INSERT INTO config.billing_type (id, name, owner) VALUES diff --git a/Open-ILS/tests/datasets/sql/libraries.sql b/Open-ILS/tests/datasets/sql/libraries.sql new file mode 100644 index 0000000000..f93edbb367 --- /dev/null +++ b/Open-ILS/tests/datasets/sql/libraries.sql @@ -0,0 +1,24 @@ +INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES + (2, 1, 2, 'SYS1', oils_i18n_gettext(2, 'Example System 1', 'aou', 'name')); +INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES + (3, 1, 2, 'SYS2', oils_i18n_gettext(3, 'Example System 2', 'aou', 'name')); +INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES + (4, 2, 3, 'BR1', oils_i18n_gettext(4, 'Example Branch 1', 'aou', 'name')); +INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES + (5, 2, 3, 'BR2', oils_i18n_gettext(5, 'Example Branch 2', 'aou', 'name')); +INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES + (6, 3, 3, 'BR3', oils_i18n_gettext(6, 'Example Branch 3', 'aou', 'name')); +INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES + (7, 3, 3, 'BR4', oils_i18n_gettext(7, 'Example Branch 4', 'aou', 'name')); +INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES + (8, 4, 4, 'SL1', oils_i18n_gettext(8, 'Example Sub-library 1', 'aou', 'name')); +INSERT INTO actor.org_unit (id, parent_ou, ou_type, shortname, name) VALUES + (9, 6, 5, 'BM1', oils_i18n_gettext(9, 'Example Bookmobile 1', 'aou', 'name')); + +INSERT INTO actor.org_address (org_unit, street1, city, state, country, post_code) +SELECT id, '123 Main St.', 'Anywhere', 'GA', 'US', '30303' +FROM actor.org_unit; + +UPDATE actor.org_unit SET holds_address = id, ill_address = id, billing_address = id, mailing_address = id; + + diff --git a/Open-ILS/tests/datasets/sql/load_all.sql b/Open-ILS/tests/datasets/sql/load_all.sql index 4d051fa612..0589baccb1 100644 --- a/Open-ILS/tests/datasets/sql/load_all.sql +++ b/Open-ILS/tests/datasets/sql/load_all.sql @@ -6,6 +6,9 @@ BEGIN; -- build functions, tables \i env_create.sql +-- load libraries (org unit) +\i libraries.sql + -- load concerto authorities \i auth_concerto.sql diff --git a/Open-ILS/tests/datasets/sql/load_concerto.sql b/Open-ILS/tests/datasets/sql/load_concerto.sql index 7394ca31c5..73c66ffd56 100644 --- a/Open-ILS/tests/datasets/sql/load_concerto.sql +++ b/Open-ILS/tests/datasets/sql/load_concerto.sql @@ -6,6 +6,9 @@ BEGIN; -- build functions, tables \i env_create.sql +-- load libraries (org units) +\i libraries.sql + -- load concerto authorities \i auth_concerto.sql -- 2.11.0