From: Jane Sandberg Date: Wed, 4 Sep 2019 18:11:43 +0000 (-0700) Subject: LP1832897 and LP1721036: stamping upgrade scripts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=40b5853bd226041d991c0c356db2e6d016bf2410;p=working%2FEvergreen.git LP1832897 and LP1721036: stamping upgrade scripts Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 8afa76e79f..12db6e1c8b 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1173', :eg_version); -- berick/khuckins/gmcharlt +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1175', :eg_version); -- gmcharlt/berick/miker/sandbergja CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1174.schema.asset.copy_tag.url.sql b/Open-ILS/src/sql/Pg/upgrade/1174.schema.asset.copy_tag.url.sql new file mode 100644 index 0000000000..700d355c43 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1174.schema.asset.copy_tag.url.sql @@ -0,0 +1,8 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1174', :eg_version); + +ALTER TABLE asset.copy_tag + ADD COLUMN url TEXT; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/1175.schema.carousels.sql b/Open-ILS/src/sql/Pg/upgrade/1175.schema.carousels.sql new file mode 100644 index 0000000000..5ea5acf4ff --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1175.schema.carousels.sql @@ -0,0 +1,63 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1175', :eg_version); + +CREATE TABLE config.carousel_type ( + id SERIAL PRIMARY KEY, + name TEXT NOT NULL, + automatic BOOLEAN NOT NULL DEFAULT TRUE, + filter_by_age BOOLEAN NOT NULL DEFAULT FALSE, + filter_by_copy_owning_lib BOOLEAN NOT NULL DEFAULT FALSE, + filter_by_copy_location BOOLEAN NOT NULL DEFAULT FALSE +); + +INSERT INTO config.carousel_type + (id, name, automatic, filter_by_age, filter_by_copy_owning_lib, filter_by_copy_location) +VALUES + (1, 'Manual', FALSE, FALSE, FALSE, FALSE), + (2, 'Newly Catalogued Items', TRUE, TRUE, TRUE, TRUE), + (3, 'Recently Returned Items', TRUE, TRUE, TRUE, TRUE), + (4, 'Top Circulated Items', TRUE, TRUE, TRUE, FALSE), + (5, 'Newest Items By Shelving Location', TRUE, TRUE, TRUE, FALSE) +; + +SELECT SETVAL('config.carousel_type_id_seq'::TEXT, 100); + +CREATE TABLE container.carousel ( + id SERIAL PRIMARY KEY, + type INTEGER NOT NULL REFERENCES config.carousel_type (id), + owner INTEGER NOT NULL REFERENCES actor.org_unit (id), + name TEXT NOT NULL, + bucket INTEGER REFERENCES container.biblio_record_entry_bucket (id), + creator INTEGER NOT NULL REFERENCES actor.usr (id), + editor INTEGER NOT NULL REFERENCES actor.usr (id), + create_time TIMESTAMPTZ NOT NULL DEFAULT now(), + edit_time TIMESTAMPTZ NOT NULL DEFAULT now(), + age_filter INTERVAL, + owning_lib_filter INT[], + copy_location_filter INT[], + last_refresh_time TIMESTAMPTZ, + active BOOLEAN NOT NULL DEFAULT TRUE, + max_items INTEGER NOT NULL +); + +CREATE TABLE container.carousel_org_unit ( + id SERIAL PRIMARY KEY, + carousel INTEGER NOT NULL REFERENCES container.carousel (id) ON DELETE CASCADE, + override_name TEXT, + org_unit INTEGER NOT NULL REFERENCES actor.org_unit (id), + seq INTEGER NOT NULL +); + +INSERT INTO container.biblio_record_entry_bucket_type (code, label) VALUES ('carousel', 'Carousel'); + +INSERT INTO permission.perm_list ( id, code, description ) VALUES + ( 612, 'ADMIN_CAROUSEL_TYPE', oils_i18n_gettext(611, + 'Allow a user to manage carousel types', 'ppl', 'description')), + ( 613, 'ADMIN_CAROUSEL', oils_i18n_gettext(612, + 'Allow a user to manage carousels', 'ppl', 'description')), + ( 614, 'REFRESH_CAROUSEL', oils_i18n_gettext(613, + 'Allow a user to refresh carousels', 'ppl', 'description')) +; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.asset.copy_tag.url.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.asset.copy_tag.url.sql deleted file mode 100644 index b7b26ceb09..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.asset.copy_tag.url.sql +++ /dev/null @@ -1,8 +0,0 @@ -BEGIN; - ---INSERT INTO config.upgrade_log (version, applied_to) VALUES ('XXXX', :eg_version); - -ALTER TABLE asset.copy_tag - ADD COLUMN url TEXT; - -COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.carousels.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.carousels.sql deleted file mode 100644 index 9dd366952e..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.carousels.sql +++ /dev/null @@ -1,63 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -CREATE TABLE config.carousel_type ( - id SERIAL PRIMARY KEY, - name TEXT NOT NULL, - automatic BOOLEAN NOT NULL DEFAULT TRUE, - filter_by_age BOOLEAN NOT NULL DEFAULT FALSE, - filter_by_copy_owning_lib BOOLEAN NOT NULL DEFAULT FALSE, - filter_by_copy_location BOOLEAN NOT NULL DEFAULT FALSE -); - -INSERT INTO config.carousel_type - (id, name, automatic, filter_by_age, filter_by_copy_owning_lib, filter_by_copy_location) -VALUES - (1, 'Manual', FALSE, FALSE, FALSE, FALSE), - (2, 'Newly Catalogued Items', TRUE, TRUE, TRUE, TRUE), - (3, 'Recently Returned Items', TRUE, TRUE, TRUE, TRUE), - (4, 'Top Circulated Items', TRUE, TRUE, TRUE, FALSE), - (5, 'Newest Items By Shelving Location', TRUE, TRUE, TRUE, FALSE) -; - -SELECT SETVAL('config.carousel_type_id_seq'::TEXT, 100); - -CREATE TABLE container.carousel ( - id SERIAL PRIMARY KEY, - type INTEGER NOT NULL REFERENCES config.carousel_type (id), - owner INTEGER NOT NULL REFERENCES actor.org_unit (id), - name TEXT NOT NULL, - bucket INTEGER REFERENCES container.biblio_record_entry_bucket (id), - creator INTEGER NOT NULL REFERENCES actor.usr (id), - editor INTEGER NOT NULL REFERENCES actor.usr (id), - create_time TIMESTAMPTZ NOT NULL DEFAULT now(), - edit_time TIMESTAMPTZ NOT NULL DEFAULT now(), - age_filter INTERVAL, - owning_lib_filter INT[], - copy_location_filter INT[], - last_refresh_time TIMESTAMPTZ, - active BOOLEAN NOT NULL DEFAULT TRUE, - max_items INTEGER NOT NULL -); - -CREATE TABLE container.carousel_org_unit ( - id SERIAL PRIMARY KEY, - carousel INTEGER NOT NULL REFERENCES container.carousel (id) ON DELETE CASCADE, - override_name TEXT, - org_unit INTEGER NOT NULL REFERENCES actor.org_unit (id), - seq INTEGER NOT NULL -); - -INSERT INTO container.biblio_record_entry_bucket_type (code, label) VALUES ('carousel', 'Carousel'); - -INSERT INTO permission.perm_list ( id, code, description ) VALUES - ( 612, 'ADMIN_CAROUSEL_TYPE', oils_i18n_gettext(611, - 'Allow a user to manage carousel types', 'ppl', 'description')), - ( 613, 'ADMIN_CAROUSEL', oils_i18n_gettext(612, - 'Allow a user to manage carousels', 'ppl', 'description')), - ( 614, 'REFRESH_CAROUSEL', oils_i18n_gettext(613, - 'Allow a user to refresh carousels', 'ppl', 'description')) -; - -COMMIT;