blob: 0e15d4d3a2139ea604afe63bfd43ef908c79d7f3 [file] [log] [blame]
sebdetb1db9f92019-03-11 14:33:54 +01001
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,
sebdet09bc8452019-05-23 17:34:07 +020010 log_component varchar(255) not null,
sebdetb1db9f92019-03-11 14:33:54 +010011 log_instant datetime(6) not null,
12 log_type varchar(255) not null,
sebdet584cc4a2019-05-03 14:32:53 +020013 message MEDIUMTEXT not null,
sebdetb1db9f92019-03-11 14:33:54 +010014 loop_id varchar(255) not null,
15 primary key (id)
16 ) engine=InnoDB;
17
18 create table loops (
19 name varchar(255) not null,
sebdet92cc4182019-03-12 15:08:11 +010020 blueprint_yaml MEDIUMTEXT not null,
sebdetb1db9f92019-03-11 14:33:54 +010021 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,
sebdet292e2c72019-08-20 06:51:59 -070027 operational_policy_schema json,
sebdetd0222812019-03-12 16:35:25 +010028 svg_representation MEDIUMTEXT,
sebdetb1db9f92019-03-11 14:33:54 +010029 primary key (name)
30 ) engine=InnoDB;
31
32 create table loops_microservicepolicies (
33 loop_id varchar(255) not null,
34 microservicepolicy_id varchar(255) not null,
35 primary key (loop_id, microservicepolicy_id)
36 ) engine=InnoDB;
37
38 create table micro_service_policies (
39 name varchar(255) not null,
40 json_representation json not null,
xg353ya6d09fb2019-03-28 10:05:25 +010041 model_type varchar(255) not null,
sebdet92cc4182019-03-12 15:08:11 +010042 policy_tosca MEDIUMTEXT not null,
sebdetb1db9f92019-03-11 14:33:54 +010043 properties json,
44 shared bit not null,
45 primary key (name)
46 ) engine=InnoDB;
47
48 create table operational_policies (
49 name varchar(255) not null,
50 configurations_json json,
51 loop_id varchar(255) not null,
52 primary key (name)
53 ) engine=InnoDB;
54
55 alter table loop_logs
56 add constraint FK1j0cda46aickcaoxqoo34khg2
57 foreign key (loop_id)
58 references loops (name);
59
60 alter table loops_microservicepolicies
61 add constraint FKem7tp1cdlpwe28av7ef91j1yl
62 foreign key (microservicepolicy_id)
63 references micro_service_policies (name);
64
65 alter table loops_microservicepolicies
66 add constraint FKsvx91jekgdkfh34iaxtjfgebt
67 foreign key (loop_id)
68 references loops (name);
69
70 alter table operational_policies
71 add constraint FK1ddoggk9ni2bnqighv6ecmuwu
72 foreign key (loop_id)
73 references loops (name);