From 56bda6b067417e159a8e24d65372a12d32068a06 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 31 Jan 2023 18:07:52 +0000 Subject: [PATCH] add missing sql files --- .../container_files/mysql/createDBforMP.sql | 7 +++ .../container_files/mysql/setupDBforMP.sql | 60 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 Workbench/grouper_data/container_files/mysql/createDBforMP.sql create mode 100644 Workbench/grouper_data/container_files/mysql/setupDBforMP.sql diff --git a/Workbench/grouper_data/container_files/mysql/createDBforMP.sql b/Workbench/grouper_data/container_files/mysql/createDBforMP.sql new file mode 100644 index 0000000..8cf329f --- /dev/null +++ b/Workbench/grouper_data/container_files/mysql/createDBforMP.sql @@ -0,0 +1,7 @@ +CREATE DATABASE grouper_to_midpoint CHARACTER SET utf8 COLLATE utf8_bin; +CREATE USER 'grouper'@'%' IDENTIFIED BY 'password'; +CREATE USER 'grouper'@'localhost' IDENTIFIED BY 'password'; +GRANT ALL PRIVILEGES ON * . * TO 'grouper'@'%'; +GRANT ALL PRIVILEGES ON * . * TO 'grouper'@'localhost'; +FLUSH PRIVILEGES; + diff --git a/Workbench/grouper_data/container_files/mysql/setupDBforMP.sql b/Workbench/grouper_data/container_files/mysql/setupDBforMP.sql new file mode 100644 index 0000000..be1e73e --- /dev/null +++ b/Workbench/grouper_data/container_files/mysql/setupDBforMP.sql @@ -0,0 +1,60 @@ +USE grouper_to_midpoint; +CREATE TABLE gr_mp_groups ( + group_name varchar(1024) DEFAULT NULL, + id_index bigint NOT NULL, + display_name varchar(1024) DEFAULT NULL, + description varchar(1024) DEFAULT NULL, + last_modified bigint NOT NULL, + deleted varchar(1) NOT NULL, + PRIMARY KEY (id_index), + UNIQUE KEY gr_mp_groups_ldx (last_modified), + UNIQUE KEY gr_mp_groups_idx (id_index), + KEY gr_mp_groups_ddx (display_name(255)), + KEY gr_mp_groups_gdx (group_name(255)) +); + +CREATE TABLE gr_mp_group_attributes ( + group_id_index bigint NOT NULL, + attribute_name varchar(1000) NOT NULL, + attribute_value varchar(4000) DEFAULT NULL, + last_modified bigint NOT NULL, + deleted varchar(1) NOT NULL, + UNIQUE KEY gr_mp_group_attributes_ldx (last_modified), + UNIQUE KEY gr_mp_group_attributes_idx (group_id_index,attribute_name(100),attribute_value(155)), + CONSTRAINT gr_mp_group_attributes_fk FOREIGN KEY (group_id_index) REFERENCES gr_mp_groups (id_index) +); + +CREATE TABLE gr_mp_subjects ( + subject_id_index bigint NOT NULL, + subject_id varchar(1024) DEFAULT NULL, + last_modified bigint NOT NULL, + deleted varchar(1) NOT NULL, + PRIMARY KEY (subject_id_index), + UNIQUE KEY gr_mp_subjects_ldx (last_modified), + UNIQUE KEY gr_mp_subjects_idx (subject_id_index), + KEY gr_mp_subjects_sdx (subject_id(255)) +); + +CREATE TABLE gr_mp_subject_attributes ( + subject_id_index bigint NOT NULL, + attribute_name varchar(1000) NOT NULL, + attribute_value varchar(4000) DEFAULT NULL, + last_modified bigint NOT NULL, + deleted varchar(1) NOT NULL, + UNIQUE KEY gr_mp_subject_attributes_ldx (last_modified), + UNIQUE KEY gr_mp_subject_attributes_idx (subject_id_index,attribute_name(100),attribute_value(155)), + CONSTRAINT gr_mp_subject_attributes_fk FOREIGN KEY (subject_id_index) REFERENCES gr_mp_subjects (subject_id_index) +); + +CREATE TABLE gr_mp_memberships ( + group_id_index bigint NOT NULL, + subject_id_index bigint NOT NULL, + last_modified bigint NOT NULL, + deleted varchar(1) NOT NULL, + UNIQUE KEY gr_mp_memberships_ldx (last_modified), + UNIQUE KEY gr_mp_memberships_idx (group_id_index,subject_id_index), + KEY gr_mp_memberships_sfk (subject_id_index), + CONSTRAINT gr_mp_memberships_gfk FOREIGN KEY (group_id_index) REFERENCES gr_mp_groups (id_index), + CONSTRAINT gr_mp_memberships_sfk FOREIGN KEY (subject_id_index) REFERENCES gr_mp_subjects (subject_id_index) +); +