sebdet | b1db9f9 | 2019-03-11 14:33:54 +0100 | [diff] [blame] | 1 | |
| 2 | create table hibernate_sequence ( |
| 3 | next_val bigint |
| 4 | ) engine=InnoDB; |
| 5 | |
| 6 | insert into hibernate_sequence values ( 1 ); |
| 7 | |
| 8 | create table loop_logs ( |
| 9 | id bigint not null, |
sebdet | 09bc845 | 2019-05-23 17:34:07 +0200 | [diff] [blame] | 10 | log_component varchar(255) not null, |
sebdet | b1db9f9 | 2019-03-11 14:33:54 +0100 | [diff] [blame] | 11 | log_instant datetime(6) not null, |
| 12 | log_type varchar(255) not null, |
sebdet | 584cc4a | 2019-05-03 14:32:53 +0200 | [diff] [blame] | 13 | message MEDIUMTEXT not null, |
sebdet | b1db9f9 | 2019-03-11 14:33:54 +0100 | [diff] [blame] | 14 | loop_id varchar(255) not null, |
| 15 | primary key (id) |
| 16 | ) engine=InnoDB; |
| 17 | |
| 18 | create table loops ( |
| 19 | name varchar(255) not null, |
sebdet | 92cc418 | 2019-03-12 15:08:11 +0100 | [diff] [blame] | 20 | blueprint_yaml MEDIUMTEXT not null, |
sebdet | b1db9f9 | 2019-03-11 14:33:54 +0100 | [diff] [blame] | 21 | dcae_blueprint_id varchar(255), |
| 22 | dcae_deployment_id varchar(255), |
| 23 | dcae_deployment_status_url varchar(255), |
| 24 | global_properties_json json, |
| 25 | last_computed_state varchar(255) not null, |
| 26 | model_properties_json json, |
sebdet | d022281 | 2019-03-12 16:35:25 +0100 | [diff] [blame] | 27 | svg_representation MEDIUMTEXT, |
sebdet | b1db9f9 | 2019-03-11 14:33:54 +0100 | [diff] [blame] | 28 | primary key (name) |
| 29 | ) engine=InnoDB; |
| 30 | |
| 31 | create table loops_microservicepolicies ( |
| 32 | loop_id varchar(255) not null, |
| 33 | microservicepolicy_id varchar(255) not null, |
| 34 | primary key (loop_id, microservicepolicy_id) |
| 35 | ) engine=InnoDB; |
| 36 | |
| 37 | create table micro_service_policies ( |
| 38 | name varchar(255) not null, |
| 39 | json_representation json not null, |
xg353y | a6d09fb | 2019-03-28 10:05:25 +0100 | [diff] [blame] | 40 | model_type varchar(255) not null, |
sebdet | 92cc418 | 2019-03-12 15:08:11 +0100 | [diff] [blame] | 41 | policy_tosca MEDIUMTEXT not null, |
sebdet | b1db9f9 | 2019-03-11 14:33:54 +0100 | [diff] [blame] | 42 | properties json, |
| 43 | shared bit not null, |
| 44 | primary key (name) |
| 45 | ) engine=InnoDB; |
| 46 | |
| 47 | create table operational_policies ( |
| 48 | name varchar(255) not null, |
| 49 | configurations_json json, |
| 50 | loop_id varchar(255) not null, |
| 51 | primary key (name) |
| 52 | ) engine=InnoDB; |
| 53 | |
| 54 | alter table loop_logs |
| 55 | add constraint FK1j0cda46aickcaoxqoo34khg2 |
| 56 | foreign key (loop_id) |
| 57 | references loops (name); |
| 58 | |
| 59 | alter table loops_microservicepolicies |
| 60 | add constraint FKem7tp1cdlpwe28av7ef91j1yl |
| 61 | foreign key (microservicepolicy_id) |
| 62 | references micro_service_policies (name); |
| 63 | |
| 64 | alter table loops_microservicepolicies |
| 65 | add constraint FKsvx91jekgdkfh34iaxtjfgebt |
| 66 | foreign key (loop_id) |
| 67 | references loops (name); |
| 68 | |
| 69 | alter table operational_policies |
| 70 | add constraint FK1ddoggk9ni2bnqighv6ecmuwu |
| 71 | foreign key (loop_id) |
| 72 | references loops (name); |