32868b909604a987264ebee45301883d22e96924
[policy/engine.git] / packages / base / src / files / install / mysql / data / 170204_upgrade_script.sql
1 /*-
2 * ============LICENSE_START=======================================================
3 * ONAP Policy Engine
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *      http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
19 */
20 use onap_sdk;
21 set foreign_key_checks=0;
22 drop table if exists brmsgroup_info;
23 CREATE TABLE brmsgroup_info
24 (
25 controllerName VARCHAR(255) NOT NULL,
26 groupId VARCHAR(255) NOT NULL,
27 artifactId VARCHAR(255) NOT NULL,
28 version VARCHAR(45),
29 PRIMARY KEY (controllerName)
30 );
31 drop table if exists brmsgroup_policy;
32 CREATE TABLE brmsgroup_policy
33 (
34 policyName VARCHAR(255) NOT NULL,
35 controllerName VARCHAR(255) NOT NULL references brmsgroup_info(controllerName),
36 PRIMARY KEY(policyname)
37 );
38
39 drop table if exists operationshistory10; 
40
41 create table operationshistory10(
42 CLNAME varchar(255) not null, 
43 requestID varchar(100),
44 actor varchar(50) not null,
45 operation varchar(50) not null,
46 target varchar(50) not null,
47 starttime timestamp not null,
48 outcome varchar(50) not null,
49 message varchar(255) ,
50 subrequestId varchar(100),
51 endtime timestamp not null default current_timestamp
52 );
53
54 Insert into fn_role (ROLE_ID,ROLE_NAME,ACTIVE_YN,PRIORITY) values (5002,'Policy Super Admin','Y',10);
55 Insert into fn_role (ROLE_ID,ROLE_NAME,ACTIVE_YN,PRIORITY) values (5003,'Policy Super Editor','Y',10);
56 Insert into fn_role (ROLE_ID,ROLE_NAME,ACTIVE_YN,PRIORITY) values (5004,'Policy Super Guest','Y',10);
57 Insert into fn_role (ROLE_ID,ROLE_NAME,ACTIVE_YN,PRIORITY) values (5005,'Policy Admin','Y',10);
58 Insert into fn_role (ROLE_ID,ROLE_NAME,ACTIVE_YN,PRIORITY) values (5006,'Policy Editor','Y',10);
59 Insert into fn_role (ROLE_ID,ROLE_NAME,ACTIVE_YN,PRIORITY) values (5007,'Policy Guest','Y',10);
60
61
62 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5002,'menu_policy');
63 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5002,'policy_admin');
64 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5002,'policy_dashboard');
65 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5002,'policy_editor');
66 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5002,'policy_roles');
67 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5002,'policy_pdp');
68 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5002,'policy_dictionary');
69 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5002,'policy_push');
70
71 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5003,'menu_policy');
72 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5003,'policy_dashboard');
73 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5003,'policy_editor');
74 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5003,'policy_pdp');
75 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5003,'policy_push');
76
77 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5004,'menu_policy');
78 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5004,'policy_dashboard');
79 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5004,'policy_editor');
80 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5004,'policy_pdp');
81
82 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5005,'menu_policy');
83 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5005,'policy_dashboard');
84 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5005,'policy_editor');
85 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5005,'policy_pdp');
86 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5005,'policy_dictionary');
87 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5005,'policy_push');
88
89 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5006,'menu_policy');
90 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5006,'policy_dashboard');
91 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5006,'policy_editor');
92 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5006,'policy_pdp');
93 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5006,'policy_push');
94
95 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5007,'menu_policy');
96 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5007,'policy_dashboard');
97 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5007,'policy_editor');
98 Insert into fn_role_function (ROLE_ID,FUNCTION_CD) values (5007,'policy_pdp');
99
100 set foreign_key_checks=0;
101
102 commit;