Skip to content

Commit

Permalink
Issue RotherOSS#6: groups -> groups_table in scripts/database/*.sql
Browse files Browse the repository at this point in the history
These files might be obsolete.
  • Loading branch information
bschmalhofer committed May 7, 2020
1 parent 7163457 commit 5d710e4
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 62 deletions.
12 changes: 6 additions & 6 deletions scripts/database/otobo-initial_insert.mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ INSERT INTO users (id, first_name, last_name, login, pw, valid_id, create_by, cr
VALUES
(1, 'Admin', 'OTOBO', 'root@localhost', 'roK20XGbWEsSM', 1, 1, current_timestamp, 1, current_timestamp);
# ----------------------------------------------------------
# insert into table groups
# insert into table groups_table
# ----------------------------------------------------------
INSERT INTO groups (id, name, comments, valid_id, create_by, create_time, change_by, change_time)
INSERT INTO groups_table (id, name, comments, valid_id, create_by, create_time, change_by, change_time)
VALUES
(1, 'users', 'Group for default access.', 1, 1, current_timestamp, 1, current_timestamp);
# ----------------------------------------------------------
# insert into table groups
# insert into table groups_table
# ----------------------------------------------------------
INSERT INTO groups (id, name, comments, valid_id, create_by, create_time, change_by, change_time)
INSERT INTO groups_table (id, name, comments, valid_id, create_by, create_time, change_by, change_time)
VALUES
(2, 'admin', 'Group of all administrators.', 1, 1, current_timestamp, 1, current_timestamp);
# ----------------------------------------------------------
# insert into table groups
# insert into table groups_table
# ----------------------------------------------------------
INSERT INTO groups (id, name, comments, valid_id, create_by, create_time, change_by, change_time)
INSERT INTO groups_table (id, name, comments, valid_id, create_by, create_time, change_by, change_time)
VALUES
(3, 'stats', 'Group for statistics access.', 1, 1, current_timestamp, 1, current_timestamp);
# ----------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions scripts/database/otobo-initial_insert.oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ INSERT INTO users (first_name, last_name, login, pw, valid_id, create_by, create
VALUES
('Admin', 'OTOBO', 'root@localhost', 'roK20XGbWEsSM', 1, 1, current_timestamp, 1, current_timestamp);
-- ----------------------------------------------------------
-- insert into table groups
-- insert into table groups_table
-- ----------------------------------------------------------
INSERT INTO groups (name, comments, valid_id, create_by, create_time, change_by, change_time)
INSERT INTO groups_table (name, comments, valid_id, create_by, create_time, change_by, change_time)
VALUES
('users', 'Group for default access.', 1, 1, current_timestamp, 1, current_timestamp);
-- ----------------------------------------------------------
-- insert into table groups
-- insert into table groups_table
-- ----------------------------------------------------------
INSERT INTO groups (name, comments, valid_id, create_by, create_time, change_by, change_time)
INSERT INTO groups_table (name, comments, valid_id, create_by, create_time, change_by, change_time)
VALUES
('admin', 'Group of all administrators.', 1, 1, current_timestamp, 1, current_timestamp);
-- ----------------------------------------------------------
-- insert into table groups
-- insert into table groups_table
-- ----------------------------------------------------------
INSERT INTO groups (name, comments, valid_id, create_by, create_time, change_by, change_time)
INSERT INTO groups_table (name, comments, valid_id, create_by, create_time, change_by, change_time)
VALUES
('stats', 'Group for statistics access.', 1, 1, current_timestamp, 1, current_timestamp);
-- ----------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions scripts/database/otobo-initial_insert.postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ INSERT INTO users (first_name, last_name, login, pw, valid_id, create_by, create
VALUES
('Admin', 'OTOBO', 'root@localhost', 'roK20XGbWEsSM', 1, 1, current_timestamp, 1, current_timestamp);
-- ----------------------------------------------------------
-- insert into table groups
-- insert into table groups_table
-- ----------------------------------------------------------
INSERT INTO groups (name, comments, valid_id, create_by, create_time, change_by, change_time)
INSERT INTO groups_table (name, comments, valid_id, create_by, create_time, change_by, change_time)
VALUES
('users', 'Group for default access.', 1, 1, current_timestamp, 1, current_timestamp);
-- ----------------------------------------------------------
-- insert into table groups
-- insert into table groups_table
-- ----------------------------------------------------------
INSERT INTO groups (name, comments, valid_id, create_by, create_time, change_by, change_time)
INSERT INTO groups_table (name, comments, valid_id, create_by, create_time, change_by, change_time)
VALUES
('admin', 'Group of all administrators.', 1, 1, current_timestamp, 1, current_timestamp);
-- ----------------------------------------------------------
-- insert into table groups
-- insert into table groups_table
-- ----------------------------------------------------------
INSERT INTO groups (name, comments, valid_id, create_by, create_time, change_by, change_time)
INSERT INTO groups_table (name, comments, valid_id, create_by, create_time, change_by, change_time)
VALUES
('stats', 'Group for statistics access.', 1, 1, current_timestamp, 1, current_timestamp);
-- ----------------------------------------------------------
Expand Down
26 changes: 13 additions & 13 deletions scripts/database/otobo-schema-post.mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHER
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE user_preferences ADD CONSTRAINT FK_user_preferences_user_id_id FOREIGN KEY (user_id) REFERENCES users (id)', 'SELECT ''INFO: Foreign key constraint FK_user_preferences_user_id_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'groups' AND constraint_name = 'FK_groups_create_by_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE groups ADD CONSTRAINT FK_groups_create_by_id FOREIGN KEY (create_by) REFERENCES users (id)', 'SELECT ''INFO: Foreign key constraint FK_groups_create_by_id does already exist, skipping.''' );
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'groups_table' AND constraint_name = 'FK_groups_create_by_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE groups_table ADD CONSTRAINT FK_groups_create_by_id FOREIGN KEY (create_by) REFERENCES users (id)', 'SELECT ''INFO: Foreign key constraint FK_groups_create_by_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'groups' AND constraint_name = 'FK_groups_change_by_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE groups ADD CONSTRAINT FK_groups_change_by_id FOREIGN KEY (change_by) REFERENCES users (id)', 'SELECT ''INFO: Foreign key constraint FK_groups_change_by_id does already exist, skipping.''' );
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'groups_table' AND constraint_name = 'FK_groups_change_by_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE groups_table ADD CONSTRAINT FK_groups_change_by_id FOREIGN KEY (change_by) REFERENCES users (id)', 'SELECT ''INFO: Foreign key constraint FK_groups_change_by_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'groups' AND constraint_name = 'FK_groups_valid_id_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE groups ADD CONSTRAINT FK_groups_valid_id_id FOREIGN KEY (valid_id) REFERENCES valid (id)', 'SELECT ''INFO: Foreign key constraint FK_groups_valid_id_id does already exist, skipping.''' );
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'groups_table' AND constraint_name = 'FK_groups_valid_id_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE groups_table ADD CONSTRAINT FK_groups_valid_id_id FOREIGN KEY (valid_id) REFERENCES valid (id)', 'SELECT ''INFO: Foreign key constraint FK_groups_valid_id_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'group_user' AND constraint_name = 'FK_group_user_group_id_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_user ADD CONSTRAINT FK_group_user_group_id_id FOREIGN KEY (group_id) REFERENCES groups (id)', 'SELECT ''INFO: Foreign key constraint FK_group_user_group_id_id does already exist, skipping.''' );
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_user ADD CONSTRAINT FK_group_user_group_id_id FOREIGN KEY (group_id) REFERENCES groups_table (id)', 'SELECT ''INFO: Foreign key constraint FK_group_user_group_id_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'group_user' AND constraint_name = 'FK_group_user_create_by_id');
Expand All @@ -66,7 +66,7 @@ SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_user ADD CONSTRAINT
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'group_role' AND constraint_name = 'FK_group_role_group_id_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_role ADD CONSTRAINT FK_group_role_group_id_id FOREIGN KEY (group_id) REFERENCES groups (id)', 'SELECT ''INFO: Foreign key constraint FK_group_role_group_id_id does already exist, skipping.''' );
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_role ADD CONSTRAINT FK_group_role_group_id_id FOREIGN KEY (group_id) REFERENCES groups_table (id)', 'SELECT ''INFO: Foreign key constraint FK_group_role_group_id_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'group_role' AND constraint_name = 'FK_group_role_role_id_id');
Expand All @@ -82,7 +82,7 @@ SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_role ADD CONSTRAINT
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'group_customer_user' AND constraint_name = 'FK_group_customer_user_group_id_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_customer_user ADD CONSTRAINT FK_group_customer_user_group_id_id FOREIGN KEY (group_id) REFERENCES groups (id)', 'SELECT ''INFO: Foreign key constraint FK_group_customer_user_group_id_id does already exist, skipping.''' );
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_customer_user ADD CONSTRAINT FK_group_customer_user_group_id_id FOREIGN KEY (group_id) REFERENCES groups_table (id)', 'SELECT ''INFO: Foreign key constraint FK_group_customer_user_group_id_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'group_customer_user' AND constraint_name = 'FK_group_customer_user_create_by_id');
Expand All @@ -94,7 +94,7 @@ SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_customer_user ADD C
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'group_customer' AND constraint_name = 'FK_group_customer_group_id_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_customer ADD CONSTRAINT FK_group_customer_group_id_id FOREIGN KEY (group_id) REFERENCES groups (id)', 'SELECT ''INFO: Foreign key constraint FK_group_customer_group_id_id does already exist, skipping.''' );
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE group_customer ADD CONSTRAINT FK_group_customer_group_id_id FOREIGN KEY (group_id) REFERENCES groups_table (id)', 'SELECT ''INFO: Foreign key constraint FK_group_customer_group_id_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'group_customer' AND constraint_name = 'FK_group_customer_create_by_id');
Expand Down Expand Up @@ -210,7 +210,7 @@ SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE queue ADD CONSTRAINT FK_q
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'queue' AND constraint_name = 'FK_queue_group_id_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE queue ADD CONSTRAINT FK_queue_group_id_id FOREIGN KEY (group_id) REFERENCES groups (id)', 'SELECT ''INFO: Foreign key constraint FK_queue_group_id_id does already exist, skipping.''' );
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE queue ADD CONSTRAINT FK_queue_group_id_id FOREIGN KEY (group_id) REFERENCES groups_table (id)', 'SELECT ''INFO: Foreign key constraint FK_queue_group_id_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'queue' AND constraint_name = 'FK_queue_salutation_id_id');
Expand Down Expand Up @@ -418,7 +418,7 @@ SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE ticket_watcher ADD CONSTR
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'ticket_index' AND constraint_name = 'FK_ticket_index_group_id_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE ticket_index ADD CONSTRAINT FK_ticket_index_group_id_id FOREIGN KEY (group_id) REFERENCES groups (id)', 'SELECT ''INFO: Foreign key constraint FK_ticket_index_group_id_id does already exist, skipping.''' );
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE ticket_index ADD CONSTRAINT FK_ticket_index_group_id_id FOREIGN KEY (group_id) REFERENCES groups_table (id)', 'SELECT ''INFO: Foreign key constraint FK_ticket_index_group_id_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'ticket_index' AND constraint_name = 'FK_ticket_index_queue_id_id');
Expand Down Expand Up @@ -990,7 +990,7 @@ SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE sysconfig_deployment ADD
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'calendar' AND constraint_name = 'FK_calendar_group_id_id');
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE calendar ADD CONSTRAINT FK_calendar_group_id_id FOREIGN KEY (group_id) REFERENCES groups (id)', 'SELECT ''INFO: Foreign key constraint FK_calendar_group_id_id does already exist, skipping.''' );
SET @FKSQLStatement := IF( @FKExists = 0, 'ALTER TABLE calendar ADD CONSTRAINT FK_calendar_group_id_id FOREIGN KEY (group_id) REFERENCES groups_table (id)', 'SELECT ''INFO: Foreign key constraint FK_calendar_group_id_id does already exist, skipping.''' );
PREPARE FKStatement FROM @FKSQLStatement;
EXECUTE FKStatement;
SET @FKExists := (SELECT COUNT(*) FROM information_schema.table_constraints WHERE table_schema = DATABASE() AND table_name = 'calendar' AND constraint_name = 'FK_calendar_create_by_id');
Expand Down
Loading

0 comments on commit 5d710e4

Please sign in to comment.