blob: b4c5bf309af3ec3435a795af6d425351404a94bd [file] [log] [blame]
sebdetb1db9f92019-03-11 14:33:54 +01001
nrpandya82561262019-11-21 11:51:18 -06002 create table dictionary (
3 name varchar(255) not null,
4 created_by varchar(255),
5 created_timestamp datetime(6) not null,
6 updated_by varchar(255),
7 updated_timestamp datetime(6) not null,
8 dictionary_second_level integer,
9 dictionary_type varchar(255),
10 primary key (name)
11 ) engine=InnoDB;
12
13 create table dictionary_elements (
ash742683a83e2a2020-01-31 15:40:15 +000014 short_name varchar(255) not null,
nrpandya82561262019-11-21 11:51:18 -060015 created_by varchar(255),
16 created_timestamp datetime(6) not null,
17 updated_by varchar(255),
18 updated_timestamp datetime(6) not null,
ash742683a83e2a2020-01-31 15:40:15 +000019 description varchar(255) not null,
20 name varchar(255) not null,
21 subdictionary_name varchar(255),
nrpandya82561262019-11-21 11:51:18 -060022 type varchar(255) not null,
ash742683a83e2a2020-01-31 15:40:15 +000023 primary key (short_name)
24 ) engine=InnoDB;
25
26 create table dictionary_to_dictionaryelements (
27 dictionary_name varchar(255) not null,
28 dictionary_element_short_name varchar(255) not null,
29 primary key (dictionary_name, dictionary_element_short_name)
nrpandya82561262019-11-21 11:51:18 -060030 ) engine=InnoDB;
31
sebdetb1db9f92019-03-11 14:33:54 +010032 create table hibernate_sequence (
33 next_val bigint
34 ) engine=InnoDB;
35
36 insert into hibernate_sequence values ( 1 );
37
sebdetcef5b582020-01-21 12:40:59 +010038 create table loop_element_models (
39 name varchar(255) not null,
40 created_by varchar(255),
41 created_timestamp datetime(6) not null,
42 updated_by varchar(255),
43 updated_timestamp datetime(6) not null,
sebdet5d03e8b2020-02-03 20:27:59 +010044 blueprint_yaml MEDIUMTEXT,
sebdetb9a65312020-01-28 16:28:21 +010045 dcae_blueprint_id varchar(255),
sebdetcef5b582020-01-21 12:40:59 +010046 loop_element_type varchar(255) not null,
ash742683a83e2a2020-01-31 15:40:15 +000047 short_name varchar(255),
sebdetcef5b582020-01-21 12:40:59 +010048 primary key (name)
49 ) engine=InnoDB;
50
sebdetb1db9f92019-03-11 14:33:54 +010051 create table loop_logs (
52 id bigint not null,
sebdet09bc8452019-05-23 17:34:07 +020053 log_component varchar(255) not null,
sebdetb1db9f92019-03-11 14:33:54 +010054 log_instant datetime(6) not null,
55 log_type varchar(255) not null,
sebdet584cc4a2019-05-03 14:32:53 +020056 message MEDIUMTEXT not null,
sebdetb1db9f92019-03-11 14:33:54 +010057 loop_id varchar(255) not null,
58 primary key (id)
59 ) engine=InnoDB;
60
nrpandya82561262019-11-21 11:51:18 -060061 create table loop_templates (
62 name varchar(255) not null,
63 created_by varchar(255),
64 created_timestamp datetime(6) not null,
65 updated_by varchar(255),
66 updated_timestamp datetime(6) not null,
ash742683a83e2a2020-01-31 15:40:15 +000067 allowed_loop_type varchar(255),
xuegao9e01ce32020-01-27 12:10:32 +010068 blueprint_yaml MEDIUMTEXT,
sebdetb9a65312020-01-28 16:28:21 +010069 dcae_blueprint_id varchar(255),
nrpandya82561262019-11-21 11:51:18 -060070 maximum_instances_allowed integer,
71 svg_representation MEDIUMTEXT,
xuegao81c13442020-02-04 15:22:00 +010072 unique_blueprint boolean default false,
nrpandya82561262019-11-21 11:51:18 -060073 service_uuid varchar(255),
74 primary key (name)
75 ) engine=InnoDB;
76
sebdetcef5b582020-01-21 12:40:59 +010077 create table loopelementmodels_to_policymodels (
78 loop_element_name varchar(255) not null,
79 policy_model_type varchar(255) not null,
80 policy_model_version varchar(255) not null,
81 primary key (loop_element_name, policy_model_type, policy_model_version)
82 ) engine=InnoDB;
83
sebdetb1db9f92019-03-11 14:33:54 +010084 create table loops (
85 name varchar(255) not null,
nrpandya82561262019-11-21 11:51:18 -060086 created_by varchar(255),
87 created_timestamp datetime(6) not null,
88 updated_by varchar(255),
89 updated_timestamp datetime(6) not null,
sebdetb1db9f92019-03-11 14:33:54 +010090 dcae_deployment_id varchar(255),
91 dcae_deployment_status_url varchar(255),
92 global_properties_json json,
93 last_computed_state varchar(255) not null,
sebdetd0222812019-03-12 16:35:25 +010094 svg_representation MEDIUMTEXT,
xuegao81c13442020-02-04 15:22:00 +010095 loop_template_name varchar(255) not null,
xuegao289e8e12019-11-08 13:10:36 +010096 service_uuid varchar(255),
sebdetb1db9f92019-03-11 14:33:54 +010097 primary key (name)
98 ) engine=InnoDB;
99
sebdetcef5b582020-01-21 12:40:59 +0100100 create table loops_to_microservicepolicies (
101 loop_name varchar(255) not null,
102 microservicepolicy_name varchar(255) not null,
103 primary key (loop_name, microservicepolicy_name)
sebdetb1db9f92019-03-11 14:33:54 +0100104 ) engine=InnoDB;
105
sebdetcef5b582020-01-21 12:40:59 +0100106 create table looptemplates_to_loopelementmodels (
107 loop_element_model_name varchar(255) not null,
108 loop_template_name varchar(255) not null,
109 flow_order integer not null,
110 primary key (loop_element_model_name, loop_template_name)
nrpandya82561262019-11-21 11:51:18 -0600111 ) engine=InnoDB;
112
sebdetb1db9f92019-03-11 14:33:54 +0100113 create table micro_service_policies (
114 name varchar(255) not null,
nrpandya82561262019-11-21 11:51:18 -0600115 created_by varchar(255),
116 created_timestamp datetime(6) not null,
117 updated_by varchar(255),
118 updated_timestamp datetime(6) not null,
sebdetcef5b582020-01-21 12:40:59 +0100119 configurations_json json,
120 json_representation json not null,
121 pdp_group varchar(255),
xuegao3a264712020-02-18 14:20:23 +0100122 pdp_sub_group varchar(255),
nrpandya82561262019-11-21 11:51:18 -0600123 context varchar(255),
xuegao9e01ce32020-01-27 12:10:32 +0100124 dcae_blueprint_id varchar(255),
sebdet8d74bbf2020-01-17 15:08:39 +0100125 dcae_deployment_id varchar(255),
126 dcae_deployment_status_url varchar(255),
nrpandya82561262019-11-21 11:51:18 -0600127 device_type_scope varchar(255),
sebdetb1db9f92019-03-11 14:33:54 +0100128 shared bit not null,
sebdetcef5b582020-01-21 12:40:59 +0100129 loop_element_model_id varchar(255),
sebdet4e8e11a2020-02-17 15:31:28 -0800130 policy_model_type varchar(255),
131 policy_model_version varchar(255),
sebdetb1db9f92019-03-11 14:33:54 +0100132 primary key (name)
133 ) engine=InnoDB;
134
135 create table operational_policies (
136 name varchar(255) not null,
sebdetcef5b582020-01-21 12:40:59 +0100137 created_by varchar(255),
138 created_timestamp datetime(6) not null,
139 updated_by varchar(255),
140 updated_timestamp datetime(6) not null,
sebdetb1db9f92019-03-11 14:33:54 +0100141 configurations_json json,
xuegao62a0b7c2019-12-18 11:17:53 +0100142 json_representation json not null,
sebdetcef5b582020-01-21 12:40:59 +0100143 pdp_group varchar(255),
xuegao3a264712020-02-18 14:20:23 +0100144 pdp_sub_group varchar(255),
sebdetcef5b582020-01-21 12:40:59 +0100145 loop_element_model_id varchar(255),
nrpandya82561262019-11-21 11:51:18 -0600146 policy_model_type varchar(255),
147 policy_model_version varchar(255),
sebdet897a3e02020-02-28 06:03:51 -0800148 loop_id varchar(255) not null,
sebdetb1db9f92019-03-11 14:33:54 +0100149 primary key (name)
150 ) engine=InnoDB;
151
nrpandya82561262019-11-21 11:51:18 -0600152 create table policy_models (
153 policy_model_type varchar(255) not null,
154 version varchar(255) not null,
155 created_by varchar(255),
156 created_timestamp datetime(6) not null,
157 updated_by varchar(255),
158 updated_timestamp datetime(6) not null,
159 policy_acronym varchar(255),
160 policy_tosca MEDIUMTEXT,
xuegao3a264712020-02-18 14:20:23 +0100161 policy_pdp_group json,
nrpandya82561262019-11-21 11:51:18 -0600162 primary key (policy_model_type, version)
163 ) engine=InnoDB;
164
xuegao289e8e12019-11-08 13:10:36 +0100165 create table services (
166 service_uuid varchar(255) not null,
167 name varchar(255) not null,
168 resource_details json,
169 service_details json,
xuegao69c24992019-12-06 10:40:49 +0100170 version varchar(255),
xuegao289e8e12019-11-08 13:10:36 +0100171 primary key (service_uuid)
172 ) engine=InnoDB;
173
ash742683a83e2a2020-01-31 15:40:15 +0000174 alter table dictionary_to_dictionaryelements
175 add constraint FK68hjjinnm8nte2owstd0xwp23
176 foreign key (dictionary_element_short_name)
177 references dictionary_elements (short_name);
nrpandya82561262019-11-21 11:51:18 -0600178
ash742683a83e2a2020-01-31 15:40:15 +0000179 alter table dictionary_to_dictionaryelements
180 add constraint FKtqfxg46gsxwlm2gkl6ne3cxfe
181 foreign key (dictionary_name)
nrpandya82561262019-11-21 11:51:18 -0600182 references dictionary (name);
183
sebdetb1db9f92019-03-11 14:33:54 +0100184 alter table loop_logs
185 add constraint FK1j0cda46aickcaoxqoo34khg2
186 foreign key (loop_id)
187 references loops (name);
188
nrpandya82561262019-11-21 11:51:18 -0600189 alter table loop_templates
190 add constraint FKn692dk6281wvp1o95074uacn6
191 foreign key (service_uuid)
192 references services (service_uuid);
193
sebdetcef5b582020-01-21 12:40:59 +0100194 alter table loopelementmodels_to_policymodels
195 add constraint FK23j2q74v6kaexefy0tdabsnda
196 foreign key (policy_model_type, policy_model_version)
197 references policy_models (policy_model_type, version);
198
199 alter table loopelementmodels_to_policymodels
200 add constraint FKjag1iu0olojfwryfkvb5o0rk5
201 foreign key (loop_element_name)
202 references loop_element_models (name);
203
nrpandya82561262019-11-21 11:51:18 -0600204 alter table loops
205 add constraint FK844uwy82wt0l66jljkjqembpj
206 foreign key (loop_template_name)
207 references loop_templates (name);
208
xuegao289e8e12019-11-08 13:10:36 +0100209 alter table loops
210 add constraint FK4b9wnqopxogwek014i1shqw7w
211 foreign key (service_uuid)
212 references services (service_uuid);
213
sebdetcef5b582020-01-21 12:40:59 +0100214 alter table loops_to_microservicepolicies
215 add constraint FKle255jmi7b065fwbvmwbiehtb
216 foreign key (microservicepolicy_name)
sebdetb1db9f92019-03-11 14:33:54 +0100217 references micro_service_policies (name);
218
sebdetcef5b582020-01-21 12:40:59 +0100219 alter table loops_to_microservicepolicies
220 add constraint FK8avfqaf7xl71l7sn7a5eri68d
221 foreign key (loop_name)
sebdetb1db9f92019-03-11 14:33:54 +0100222 references loops (name);
223
sebdetcef5b582020-01-21 12:40:59 +0100224 alter table looptemplates_to_loopelementmodels
225 add constraint FK1k7nbrbugvqa0xfxkq3cj1yn9
226 foreign key (loop_element_model_name)
227 references loop_element_models (name);
228
229 alter table looptemplates_to_loopelementmodels
230 add constraint FKj29yxyw0x7ue6mwgi6d3qg748
231 foreign key (loop_template_name)
232 references loop_templates (name);
nrpandya82561262019-11-21 11:51:18 -0600233
234 alter table micro_service_policies
sebdetcef5b582020-01-21 12:40:59 +0100235 add constraint FKqvvdypacbww07fuv8xvlvdjgl
236 foreign key (loop_element_model_id)
237 references loop_element_models (name);
238
sebdet4e8e11a2020-02-17 15:31:28 -0800239 alter table micro_service_policies
240 add constraint FKn17j9ufmyhqicb6cvr1dbjvkt
241 foreign key (policy_model_type, policy_model_version)
242 references policy_models (policy_model_type, version);
243
sebdetcef5b582020-01-21 12:40:59 +0100244 alter table operational_policies
245 add constraint FKi9kh7my40737xeuaye9xwbnko
246 foreign key (loop_element_model_id)
247 references loop_element_models (name);
nrpandya82561262019-11-21 11:51:18 -0600248
sebdetb1db9f92019-03-11 14:33:54 +0100249 alter table operational_policies
nrpandya82561262019-11-21 11:51:18 -0600250 add constraint FKlsyhfkoqvkwj78ofepxhoctip
251 foreign key (policy_model_type, policy_model_version)
252 references policy_models (policy_model_type, version);
sebdet897a3e02020-02-28 06:03:51 -0800253
254 alter table operational_policies
255 add constraint FK1ddoggk9ni2bnqighv6ecmuwu
256 foreign key (loop_id)
257 references loops (name);