Changed to unmaintained
[portal/sdk.git] / ecomp-sdk / epsdk-app-os / db-scripts / EcompSdkMySql_Rollback_1707_to_1610.2_OS.sql
1 -- ---------------------------------------------------------------------------------------------------------------
2 -- This rollback script is for the OpenSource ECOMP SDK App database from version 1707 to 1610.2.
3 -- change size on 3 name columns from fn_user for the Opensource version
4 -- changed DS1 icon names to DS2 icon names
5 -- removed unnecessary fn_menu entries, updated fn_menu actions;  changes the schema name from ecomp_sdk to ecomp_sdk_os_os
6 -- ---------------------------------------------------------------------------------------------------------------
7 SET FOREIGN_KEY_CHECKS=1; 
8 CREATE DATABASE IF NOT EXISTS ecomp_sdk_os;
9
10 rename table ecomp_sdk.cr_favorite_reports to ecomp_sdk_os.cr_favorite_reports;
11 rename table ecomp_sdk.cr_filehist_log to ecomp_sdk_os.cr_filehist_log;
12 rename table ecomp_sdk.cr_folder to ecomp_sdk_os.cr_folder;
13 rename table ecomp_sdk.cr_folder_access to ecomp_sdk_os.cr_folder_access;
14 rename table ecomp_sdk.cr_hist_user_map to ecomp_sdk_os.cr_hist_user_map;
15 rename table ecomp_sdk.cr_lu_file_type to ecomp_sdk_os.cr_lu_file_type;
16 rename table ecomp_sdk.cr_raptor_action_img to ecomp_sdk_os.cr_raptor_action_img;
17 rename table ecomp_sdk.cr_raptor_pdf_img to ecomp_sdk_os.cr_raptor_pdf_img;
18 rename table ecomp_sdk.cr_remote_schema_info to ecomp_sdk_os.cr_remote_schema_info;
19 rename table ecomp_sdk.cr_report to ecomp_sdk_os.cr_report;
20 rename table ecomp_sdk.cr_report_access to ecomp_sdk_os.cr_report_access;
21 rename table ecomp_sdk.cr_report_dwnld_log to ecomp_sdk_os.cr_report_dwnld_log;
22 rename table ecomp_sdk.cr_report_email_sent_log to ecomp_sdk_os.cr_report_email_sent_log;
23 rename table ecomp_sdk.cr_report_file_history to ecomp_sdk_os.cr_report_file_history;
24 rename table ecomp_sdk.cr_report_log to ecomp_sdk_os.cr_report_log;
25 rename table ecomp_sdk.cr_report_schedule to ecomp_sdk_os.cr_report_schedule;
26 rename table ecomp_sdk.cr_report_schedule_users to ecomp_sdk_os.cr_report_schedule_users;
27 rename table ecomp_sdk.cr_report_template_map to ecomp_sdk_os.cr_report_template_map;
28 rename table ecomp_sdk.cr_schedule_activity_log to ecomp_sdk_os.cr_schedule_activity_log;
29 rename table ecomp_sdk.cr_table_join to ecomp_sdk_os.cr_table_join;
30 rename table ecomp_sdk.cr_table_role to ecomp_sdk_os.cr_table_role;
31 rename table ecomp_sdk.cr_table_source to ecomp_sdk_os.cr_table_source;
32 rename table ecomp_sdk.fn_lu_timezone to ecomp_sdk_os.fn_lu_timezone;
33 rename table ecomp_sdk.fn_user to ecomp_sdk_os.fn_user;
34 rename table ecomp_sdk.fn_role to ecomp_sdk_os.fn_role;
35 rename table ecomp_sdk.fn_audit_action to ecomp_sdk_os.fn_audit_action;
36 rename table ecomp_sdk.fn_audit_action_log to ecomp_sdk_os.fn_audit_action_log;
37 rename table ecomp_sdk.fn_lu_activity to ecomp_sdk_os.fn_lu_activity;
38 rename table ecomp_sdk.fn_audit_log to ecomp_sdk_os.fn_audit_log;
39 rename table ecomp_sdk.fn_broadcast_message to ecomp_sdk_os.fn_broadcast_message;
40 rename table ecomp_sdk.fn_chat_logs to ecomp_sdk_os.fn_chat_logs;
41 rename table ecomp_sdk.fn_chat_room to ecomp_sdk_os.fn_chat_room;
42 rename table ecomp_sdk.fn_chat_users to ecomp_sdk_os.fn_chat_users;
43 rename table ecomp_sdk.fn_datasource to ecomp_sdk_os.fn_datasource;
44 rename table ecomp_sdk.fn_function to ecomp_sdk_os.fn_function;
45 rename table ecomp_sdk.fn_lu_alert_method to ecomp_sdk_os.fn_lu_alert_method;
46 rename table ecomp_sdk.fn_lu_broadcast_site to ecomp_sdk_os.fn_lu_broadcast_site;
47 rename table ecomp_sdk.fn_lu_menu_set to ecomp_sdk_os.fn_lu_menu_set;
48 rename table ecomp_sdk.fn_lu_priority to ecomp_sdk_os.fn_lu_priority;
49 rename table ecomp_sdk.fn_lu_role_type to ecomp_sdk_os.fn_lu_role_type;
50 rename table ecomp_sdk.fn_lu_tab_set to ecomp_sdk_os.fn_lu_tab_set;
51 rename table ecomp_sdk.fn_lu_message_location to ecomp_sdk_os.fn_lu_message_location;
52 rename table ecomp_sdk.fn_menu to ecomp_sdk_os.fn_menu;
53 rename table ecomp_sdk.fn_org to ecomp_sdk_os.fn_org;
54 rename table ecomp_sdk.fn_restricted_url to ecomp_sdk_os.fn_restricted_url;
55 rename table ecomp_sdk.fn_role_composite to ecomp_sdk_os.fn_role_composite;
56 rename table ecomp_sdk.fn_role_function to ecomp_sdk_os.fn_role_function;
57 rename table ecomp_sdk.fn_tab to ecomp_sdk_os.fn_tab;
58 rename table ecomp_sdk.fn_tab_selected to ecomp_sdk_os.fn_tab_selected;
59 rename table ecomp_sdk.fn_user_pseudo_role to ecomp_sdk_os.fn_user_pseudo_role;
60 rename table ecomp_sdk.fn_user_role to ecomp_sdk_os.fn_user_role;
61 rename table ecomp_sdk.schema_info to ecomp_sdk_os.schema_info;
62 rename table ecomp_sdk.fn_app to ecomp_sdk_os.fn_app;
63 rename table ecomp_sdk.fn_workflow to ecomp_sdk_os.fn_workflow;
64 rename table ecomp_sdk.fn_schedule_workflows to ecomp_sdk_os.fn_schedule_workflows;
65 rename table ecomp_sdk.demo_bar_chart to ecomp_sdk_os.demo_bar_chart;
66 rename table ecomp_sdk.demo_bar_chart_inter to ecomp_sdk_os.demo_bar_chart_inter;
67 rename table ecomp_sdk.demo_line_chart to ecomp_sdk_os.demo_line_chart;
68 rename table ecomp_sdk.demo_pie_chart to ecomp_sdk_os.demo_pie_chart;
69 rename table ecomp_sdk.demo_util_chart to ecomp_sdk_os.demo_util_chart;
70 rename table ecomp_sdk.demo_scatter_chart to ecomp_sdk_os.demo_scatter_chart;
71 rename table ecomp_sdk.demo_scatter_plot to ecomp_sdk_os.demo_scatter_plot;
72 rename table ecomp_sdk.fn_qz_job_details to ecomp_sdk_os.fn_qz_job_details;
73 rename table ecomp_sdk.fn_qz_triggers to ecomp_sdk_os.fn_qz_triggers;
74 rename table ecomp_sdk.fn_qz_simple_triggers to ecomp_sdk_os.fn_qz_simple_triggers;
75 rename table ecomp_sdk.fn_qz_cron_triggers to ecomp_sdk_os.fn_qz_cron_triggers;
76 rename table ecomp_sdk.fn_qz_simprop_triggers to ecomp_sdk_os.fn_qz_simprop_triggers;
77 rename table ecomp_sdk.fn_qz_blob_triggers to ecomp_sdk_os.fn_qz_blob_triggers;
78 rename table ecomp_sdk.fn_qz_calendars to ecomp_sdk_os.fn_qz_calendars;
79 rename table ecomp_sdk.fn_qz_paused_trigger_grps to ecomp_sdk_os.fn_qz_paused_trigger_grps;
80 rename table ecomp_sdk.fn_qz_fired_triggers to ecomp_sdk_os.fn_qz_fired_triggers;
81 rename table ecomp_sdk.fn_qz_scheduler_state to ecomp_sdk_os.fn_qz_scheduler_state;
82 rename table ecomp_sdk.fn_qz_locks to ecomp_sdk_os.fn_qz_locks;
83 rename table ecomp_sdk.rcloudinvocation to ecomp_sdk_os.rcloudinvocation;
84 rename table ecomp_sdk.rcloudnotebook to ecomp_sdk_os.rcloudnotebook;
85
86 USE ecomp_sdk_os;
87
88 --
89 -- NAME: V_URL_ACCESS; TYPE: VIEW
90 --
91 CREATE VIEW v_url_access AS
92  SELECT DISTINCT M.ACTION AS URL,
93     M.FUNCTION_CD
94    FROM FN_MENU M
95   WHERE (M.ACTION IS NOT NULL)
96 UNION
97  SELECT DISTINCT T.ACTION AS URL,
98     T.FUNCTION_CD
99    FROM FN_TAB T
100   WHERE (T.ACTION IS NOT NULL)
101 UNION
102  SELECT R.RESTRICTED_URL AS URL,
103     R.FUNCTION_CD
104    FROM FN_RESTRICTED_URL R;
105
106 update fn_menu
107 set image_src = 'ion-home'
108 where menu_id = 2 and label = 'Home';
109
110 update fn_menu
111 set image_src = 'ion-android-apps'
112 where menu_id = 5000 and label = 'Sample Pages';
113
114 update fn_menu
115 set image_src = 'ion-ios-paper'
116 where menu_id = 8 and label = 'Reports';
117
118 update fn_menu
119 set image_src = 'ion-person'
120 where menu_id = 9 and label = 'Profile';
121
122 update fn_menu
123 set image_src = 'ion-gear-a'
124 where menu_id = 10 and label = 'Admin';
125
126 update fn_menu
127 set action = 'collaborate_list.htm'
128 where menu_id = 121 and label = 'Collaboration';
129
130 update fn_menu
131 set action = 'notebook.htm'
132 where menu_id = 150038 and label = 'Notebook';
133
134 update fn_menu
135 set action = 'admin'
136 where menu_id = 101 and label = 'Roles';
137
138 update fn_menu
139 set action = 'report_wizard.htm?r_action=report.create'
140 where menu_id = 87 and label = 'Create Reports';
141
142 delete from fn_menu 
143 where menu_id = 150022 and label = 'Menus';
144
145 delete from fn_menu 
146 where menu_id = 89 and label = 'Import';
147
148 INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (13, 'Application Logout', 1, 130, 'app_logout.htm', 'menu_logout', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', 'icon-sign-out');
149 INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (92, 'Import User', 9, 30, null, 'menu_profile_import', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', NULL); 
150 INSERT INTO fn_menu (MENU_ID, LABEL, PARENT_ID, SORT_ORDER, ACTION, FUNCTION_CD, ACTIVE_YN, SERVLET, QUERY_STRING, EXTERNAL_URL, TARGET, MENU_SET_CD, SEPARATOR_YN, IMAGE_SRC) VALUES (103, 'Broadcast Messages', 10, 50, 'admin#/broadcast_list', 'menu_admin', 'Y', NULL, NULL, NULL, NULL, 'APP', 'N', '/static/fusion/images/bubble.png'); 
151
152 alter table fn_user
153         CHANGE COLUMN FIRST_NAME FIRST_NAME VARCHAR(25) NULL DEFAULT NULL ,
154         CHANGE COLUMN MIDDLE_NAME MIDDLE_NAME VARCHAR(25) NULL DEFAULT NULL ,
155         CHANGE COLUMN LAST_NAME LAST_NAME VARCHAR(25) NULL DEFAULT NULL;
156
157 drop schema ecomp_sdk;
158
159 commit;