From: Jane Sandberg Date: Fri, 23 Sep 2022 04:16:55 +0000 (-0700) Subject: LP1842297: stamp upgrade script X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1b4c040cd75941b6b47c6b1247c2d8fc7df02e10;p=working%2FEvergreen.git LP1842297: stamp upgrade script 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 32bac0e16a..6e30a68097 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 ('1328', :eg_version); -- berick/tlittle/mmorgan +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1329', :eg_version); -- oajulianclementson/sandbergja CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1329.schema.openathens_identity.sql b/Open-ILS/src/sql/Pg/upgrade/1329.schema.openathens_identity.sql new file mode 100644 index 0000000000..bd1a53e737 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1329.schema.openathens_identity.sql @@ -0,0 +1,60 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1329', :eg_version); + +CREATE TABLE config.openathens_uid_field ( + id SERIAL PRIMARY KEY, + name TEXT NOT NULL +); + +INSERT INTO config.openathens_uid_field + (id, name) +VALUES + (1,'id'), + (2,'usrname') +; + +SELECT SETVAL('config.openathens_uid_field_id_seq'::TEXT, 100); + +CREATE TABLE config.openathens_name_field ( + id SERIAL PRIMARY KEY, + name TEXT NOT NULL +); + +INSERT INTO config.openathens_name_field + (id, name) +VALUES + (1,'id'), + (2,'usrname'), + (3,'fullname') +; + +SELECT SETVAL('config.openathens_name_field_id_seq'::TEXT, 100); + +CREATE TABLE config.openathens_identity ( + id SERIAL PRIMARY KEY, + active BOOL NOT NULL DEFAULT true, + org_unit INT NOT NULL REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, + api_key TEXT NOT NULL, + connection_id TEXT NOT NULL, + connection_uri TEXT NOT NULL, + auto_signon_enabled BOOL NOT NULL DEFAULT true, + auto_signout_enabled BOOL NOT NULL DEFAULT false, + unique_identifier INT NOT NULL REFERENCES config.openathens_uid_field (id) DEFAULT 1, + display_name INT NOT NULL REFERENCES config.openathens_name_field (id) DEFAULT 1, + release_prefix BOOL NOT NULL DEFAULT false, + release_first_given_name BOOL NOT NULL DEFAULT false, + release_second_given_name BOOL NOT NULL DEFAULT false, + release_family_name BOOL NOT NULL DEFAULT false, + release_suffix BOOL NOT NULL DEFAULT false, + release_email BOOL NOT NULL DEFAULT false, + release_home_ou BOOL NOT NULL DEFAULT false, + release_barcode BOOL NOT NULL DEFAULT false +); + + +INSERT INTO permission.perm_list ( id, code, description) VALUES + ( 639, 'ADMIN_OPENATHENS', oils_i18n_gettext(639, + 'Allow a user to administer OpenAthens authentication service', 'ppl', 'description')); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.openathens_identity.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.openathens_identity.sql deleted file mode 100644 index d27dc4f3ad..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.openathens_identity.sql +++ /dev/null @@ -1,60 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -CREATE TABLE config.openathens_uid_field ( - id SERIAL PRIMARY KEY, - name TEXT NOT NULL -); - -INSERT INTO config.openathens_uid_field - (id, name) -VALUES - (1,'id'), - (2,'usrname') -; - -SELECT SETVAL('config.openathens_uid_field_id_seq'::TEXT, 100); - -CREATE TABLE config.openathens_name_field ( - id SERIAL PRIMARY KEY, - name TEXT NOT NULL -); - -INSERT INTO config.openathens_name_field - (id, name) -VALUES - (1,'id'), - (2,'usrname'), - (3,'fullname') -; - -SELECT SETVAL('config.openathens_name_field_id_seq'::TEXT, 100); - -CREATE TABLE config.openathens_identity ( - id SERIAL PRIMARY KEY, - active BOOL NOT NULL DEFAULT true, - org_unit INT NOT NULL REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, - api_key TEXT NOT NULL, - connection_id TEXT NOT NULL, - connection_uri TEXT NOT NULL, - auto_signon_enabled BOOL NOT NULL DEFAULT true, - auto_signout_enabled BOOL NOT NULL DEFAULT false, - unique_identifier INT NOT NULL REFERENCES config.openathens_uid_field (id) DEFAULT 1, - display_name INT NOT NULL REFERENCES config.openathens_name_field (id) DEFAULT 1, - release_prefix BOOL NOT NULL DEFAULT false, - release_first_given_name BOOL NOT NULL DEFAULT false, - release_second_given_name BOOL NOT NULL DEFAULT false, - release_family_name BOOL NOT NULL DEFAULT false, - release_suffix BOOL NOT NULL DEFAULT false, - release_email BOOL NOT NULL DEFAULT false, - release_home_ou BOOL NOT NULL DEFAULT false, - release_barcode BOOL NOT NULL DEFAULT false -); - - -INSERT INTO permission.perm_list ( id, code, description) VALUES - ( 639, 'ADMIN_OPENATHENS', oils_i18n_gettext(639, - 'Allow a user to administer OpenAthens authentication service', 'ppl', 'description')); - -COMMIT;