blob: 819d92591214d1378f65ba394dc104c113b99636 [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 (
14 name varchar(255) not null,
15 created_by varchar(255),
16 created_timestamp datetime(6) not null,
17 updated_by varchar(255),
18 updated_timestamp datetime(6) not null,
19 description varchar(255),
20 short_name varchar(255) not null,
21 subdictionary_id varchar(255) not null,
22 type varchar(255) not null,
23 dictionary_id varchar(255),
24 primary key (name)
25 ) engine=InnoDB;
26
sebdetb1db9f92019-03-11 14:33:54 +010027 create table hibernate_sequence (
28 next_val bigint
29 ) engine=InnoDB;
30
31 insert into hibernate_sequence values ( 1 );
32
sebdetcef5b582020-01-21 12:40:59 +010033 create table loop_element_models (
34 name varchar(255) not null,
35 created_by varchar(255),
36 created_timestamp datetime(6) not null,
37 updated_by varchar(255),
38 updated_timestamp datetime(6) not null,
sebdetb9a65312020-01-28 16:28:21 +010039 blueprint_yaml MEDIUMTEXT not null,
40 dcae_blueprint_id varchar(255),
sebdetcef5b582020-01-21 12:40:59 +010041 loop_element_type varchar(255) not null,
42 primary key (name)
43 ) engine=InnoDB;
44
sebdetb1db9f92019-03-11 14:33:54 +010045 create table loop_logs (
46 id bigint not null,
sebdet09bc8452019-05-23 17:34:07 +020047 log_component varchar(255) not null,
sebdetb1db9f92019-03-11 14:33:54 +010048 log_instant datetime(6) not null,
49 log_type varchar(255) not null,
sebdet584cc4a2019-05-03 14:32:53 +020050 message MEDIUMTEXT not null,
sebdetb1db9f92019-03-11 14:33:54 +010051 loop_id varchar(255) not null,
52 primary key (id)
53 ) engine=InnoDB;
54
nrpandya82561262019-11-21 11:51:18 -060055 create table loop_templates (
56 name varchar(255) not null,
57 created_by varchar(255),
58 created_timestamp datetime(6) not null,
59 updated_by varchar(255),
60 updated_timestamp datetime(6) not null,
xuegao9e01ce32020-01-27 12:10:32 +010061 blueprint_yaml MEDIUMTEXT,
sebdetb9a65312020-01-28 16:28:21 +010062 dcae_blueprint_id varchar(255),
nrpandya82561262019-11-21 11:51:18 -060063 maximum_instances_allowed integer,
64 svg_representation MEDIUMTEXT,
xuegao81c13442020-02-04 15:22:00 +010065 unique_blueprint boolean default false,
nrpandya82561262019-11-21 11:51:18 -060066 service_uuid varchar(255),
67 primary key (name)
68 ) engine=InnoDB;
69
sebdetcef5b582020-01-21 12:40:59 +010070 create table loopelementmodels_to_policymodels (
71 loop_element_name varchar(255) not null,
72 policy_model_type varchar(255) not null,
73 policy_model_version varchar(255) not null,
74 primary key (loop_element_name, policy_model_type, policy_model_version)
75 ) engine=InnoDB;
76
sebdetb1db9f92019-03-11 14:33:54 +010077 create table loops (
78 name varchar(255) not null,
nrpandya82561262019-11-21 11:51:18 -060079 created_by varchar(255),
80 created_timestamp datetime(6) not null,
81 updated_by varchar(255),
82 updated_timestamp datetime(6) not null,
sebdetb1db9f92019-03-11 14:33:54 +010083 dcae_deployment_id varchar(255),
84 dcae_deployment_status_url varchar(255),
85 global_properties_json json,
86 last_computed_state varchar(255) not null,
sebdetd0222812019-03-12 16:35:25 +010087 svg_representation MEDIUMTEXT,
xuegao81c13442020-02-04 15:22:00 +010088 loop_template_name varchar(255) not null,
xuegao289e8e12019-11-08 13:10:36 +010089 service_uuid varchar(255),
sebdetb1db9f92019-03-11 14:33:54 +010090 primary key (name)
91 ) engine=InnoDB;
92
sebdetcef5b582020-01-21 12:40:59 +010093 create table loops_to_microservicepolicies (
94 loop_name varchar(255) not null,
95 microservicepolicy_name varchar(255) not null,
96 primary key (loop_name, microservicepolicy_name)
sebdetb1db9f92019-03-11 14:33:54 +010097 ) engine=InnoDB;
98
sebdetcef5b582020-01-21 12:40:59 +010099 create table looptemplates_to_loopelementmodels (
100 loop_element_model_name varchar(255) not null,
101 loop_template_name varchar(255) not null,
102 flow_order integer not null,
103 primary key (loop_element_model_name, loop_template_name)
nrpandya82561262019-11-21 11:51:18 -0600104 ) engine=InnoDB;
105
sebdetb1db9f92019-03-11 14:33:54 +0100106 create table micro_service_policies (
107 name varchar(255) not null,
nrpandya82561262019-11-21 11:51:18 -0600108 created_by varchar(255),
109 created_timestamp datetime(6) not null,
110 updated_by varchar(255),
111 updated_timestamp datetime(6) not null,
sebdetcef5b582020-01-21 12:40:59 +0100112 configurations_json json,
113 json_representation json not null,
114 pdp_group varchar(255),
nrpandya82561262019-11-21 11:51:18 -0600115 context varchar(255),
xuegao9e01ce32020-01-27 12:10:32 +0100116 dcae_blueprint_id varchar(255),
sebdet8d74bbf2020-01-17 15:08:39 +0100117 dcae_deployment_id varchar(255),
118 dcae_deployment_status_url varchar(255),
nrpandya82561262019-11-21 11:51:18 -0600119 device_type_scope varchar(255),
nrpandya82561262019-11-21 11:51:18 -0600120 policy_model_type varchar(255) not null,
sebdet92cc4182019-03-12 15:08:11 +0100121 policy_tosca MEDIUMTEXT not null,
sebdetb1db9f92019-03-11 14:33:54 +0100122 shared bit not null,
sebdetcef5b582020-01-21 12:40:59 +0100123 loop_element_model_id varchar(255),
sebdetb1db9f92019-03-11 14:33:54 +0100124 primary key (name)
125 ) engine=InnoDB;
126
127 create table operational_policies (
128 name varchar(255) not null,
sebdetcef5b582020-01-21 12:40:59 +0100129 created_by varchar(255),
130 created_timestamp datetime(6) not null,
131 updated_by varchar(255),
132 updated_timestamp datetime(6) not null,
sebdetb1db9f92019-03-11 14:33:54 +0100133 configurations_json json,
xuegao62a0b7c2019-12-18 11:17:53 +0100134 json_representation json not null,
sebdetcef5b582020-01-21 12:40:59 +0100135 pdp_group varchar(255),
136 loop_element_model_id varchar(255),
sebdetb1db9f92019-03-11 14:33:54 +0100137 loop_id varchar(255) not null,
nrpandya82561262019-11-21 11:51:18 -0600138 policy_model_type varchar(255),
139 policy_model_version varchar(255),
sebdetb1db9f92019-03-11 14:33:54 +0100140 primary key (name)
141 ) engine=InnoDB;
142
nrpandya82561262019-11-21 11:51:18 -0600143 create table policy_models (
144 policy_model_type varchar(255) not null,
145 version varchar(255) not null,
146 created_by varchar(255),
147 created_timestamp datetime(6) not null,
148 updated_by varchar(255),
149 updated_timestamp datetime(6) not null,
150 policy_acronym varchar(255),
151 policy_tosca MEDIUMTEXT,
nrpandya82561262019-11-21 11:51:18 -0600152 primary key (policy_model_type, version)
153 ) engine=InnoDB;
154
xuegao289e8e12019-11-08 13:10:36 +0100155 create table services (
156 service_uuid varchar(255) not null,
157 name varchar(255) not null,
158 resource_details json,
159 service_details json,
xuegao69c24992019-12-06 10:40:49 +0100160 version varchar(255),
xuegao289e8e12019-11-08 13:10:36 +0100161 primary key (service_uuid)
162 ) engine=InnoDB;
163
nrpandya82561262019-11-21 11:51:18 -0600164 alter table dictionary_elements
165 add constraint UK_qxkrvsrhp26m60apfvxphpl3d unique (short_name);
166
167 alter table dictionary_elements
168 add constraint FKn87bpgpm9i56w7uko585rbkgn
169 foreign key (dictionary_id)
170 references dictionary (name);
171
sebdetb1db9f92019-03-11 14:33:54 +0100172 alter table loop_logs
173 add constraint FK1j0cda46aickcaoxqoo34khg2
174 foreign key (loop_id)
175 references loops (name);
176
nrpandya82561262019-11-21 11:51:18 -0600177 alter table loop_templates
178 add constraint FKn692dk6281wvp1o95074uacn6
179 foreign key (service_uuid)
180 references services (service_uuid);
181
sebdetcef5b582020-01-21 12:40:59 +0100182 alter table loopelementmodels_to_policymodels
183 add constraint FK23j2q74v6kaexefy0tdabsnda
184 foreign key (policy_model_type, policy_model_version)
185 references policy_models (policy_model_type, version);
186
187 alter table loopelementmodels_to_policymodels
188 add constraint FKjag1iu0olojfwryfkvb5o0rk5
189 foreign key (loop_element_name)
190 references loop_element_models (name);
191
nrpandya82561262019-11-21 11:51:18 -0600192 alter table loops
193 add constraint FK844uwy82wt0l66jljkjqembpj
194 foreign key (loop_template_name)
195 references loop_templates (name);
196
xuegao289e8e12019-11-08 13:10:36 +0100197 alter table loops
198 add constraint FK4b9wnqopxogwek014i1shqw7w
199 foreign key (service_uuid)
200 references services (service_uuid);
201
sebdetcef5b582020-01-21 12:40:59 +0100202 alter table loops_to_microservicepolicies
203 add constraint FKle255jmi7b065fwbvmwbiehtb
204 foreign key (microservicepolicy_name)
sebdetb1db9f92019-03-11 14:33:54 +0100205 references micro_service_policies (name);
206
sebdetcef5b582020-01-21 12:40:59 +0100207 alter table loops_to_microservicepolicies
208 add constraint FK8avfqaf7xl71l7sn7a5eri68d
209 foreign key (loop_name)
sebdetb1db9f92019-03-11 14:33:54 +0100210 references loops (name);
211
sebdetcef5b582020-01-21 12:40:59 +0100212 alter table looptemplates_to_loopelementmodels
213 add constraint FK1k7nbrbugvqa0xfxkq3cj1yn9
214 foreign key (loop_element_model_name)
215 references loop_element_models (name);
216
217 alter table looptemplates_to_loopelementmodels
218 add constraint FKj29yxyw0x7ue6mwgi6d3qg748
219 foreign key (loop_template_name)
220 references loop_templates (name);
nrpandya82561262019-11-21 11:51:18 -0600221
222 alter table micro_service_policies
sebdetcef5b582020-01-21 12:40:59 +0100223 add constraint FKqvvdypacbww07fuv8xvlvdjgl
224 foreign key (loop_element_model_id)
225 references loop_element_models (name);
226
227 alter table operational_policies
228 add constraint FKi9kh7my40737xeuaye9xwbnko
229 foreign key (loop_element_model_id)
230 references loop_element_models (name);
nrpandya82561262019-11-21 11:51:18 -0600231
sebdetb1db9f92019-03-11 14:33:54 +0100232 alter table operational_policies
233 add constraint FK1ddoggk9ni2bnqighv6ecmuwu
234 foreign key (loop_id)
235 references loops (name);
nrpandya82561262019-11-21 11:51:18 -0600236
237 alter table operational_policies
238 add constraint FKlsyhfkoqvkwj78ofepxhoctip
239 foreign key (policy_model_type, policy_model_version)
240 references policy_models (policy_model_type, version);