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