blob: 6e9ff7c867503a2401fce99b096f0d45b87e9a09 [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,
sebdetd0222812019-03-12 16:35:25 +010026 svg_representation MEDIUMTEXT,
xuegao289e8e12019-11-08 13:10:36 +010027 service_uuid varchar(255),
sebdetb1db9f92019-03-11 14:33:54 +010028 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,
xg353ya6d09fb2019-03-28 10:05:25 +010040 model_type varchar(255) not null,
sebdet92cc4182019-03-12 15:08:11 +010041 policy_tosca MEDIUMTEXT not null,
sebdetb1db9f92019-03-11 14:33:54 +010042 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,
xuegao62a0b7c2019-12-18 11:17:53 +010050 json_representation json not null,
sebdetb1db9f92019-03-11 14:33:54 +010051 loop_id varchar(255) not null,
52 primary key (name)
53 ) engine=InnoDB;
54
xuegao289e8e12019-11-08 13:10:36 +010055 create table services (
56 service_uuid varchar(255) not null,
57 name varchar(255) not null,
58 resource_details json,
59 service_details json,
xuegao69c24992019-12-06 10:40:49 +010060 version varchar(255),
xuegao289e8e12019-11-08 13:10:36 +010061 primary key (service_uuid)
62 ) engine=InnoDB;
63
sebdetb1db9f92019-03-11 14:33:54 +010064 alter table loop_logs
65 add constraint FK1j0cda46aickcaoxqoo34khg2
66 foreign key (loop_id)
67 references loops (name);
68
xuegao289e8e12019-11-08 13:10:36 +010069 alter table loops
70 add constraint FK4b9wnqopxogwek014i1shqw7w
71 foreign key (service_uuid)
72 references services (service_uuid);
73
sebdetb1db9f92019-03-11 14:33:54 +010074 alter table loops_microservicepolicies
75 add constraint FKem7tp1cdlpwe28av7ef91j1yl
76 foreign key (microservicepolicy_id)
77 references micro_service_policies (name);
78
79 alter table loops_microservicepolicies
80 add constraint FKsvx91jekgdkfh34iaxtjfgebt
81 foreign key (loop_id)
82 references loops (name);
83
84 alter table operational_policies
85 add constraint FK1ddoggk9ni2bnqighv6ecmuwu
86 foreign key (loop_id)
87 references loops (name);