Revert "basic auth for so-monitoring"
[oom.git] / kubernetes / clamp / charts / mariadb / resources / config / mariadb / docker-entrypoint-initdb.d / bulkload / create-tables.sql
1 /* Copyright © 2019 AT&T
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *       http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15     create table hibernate_sequence (
16        next_val bigint
17     ) engine=InnoDB;
18
19     insert into hibernate_sequence values ( 1 );
20
21     create table loop_logs (
22        id bigint not null,
23         log_component varchar(255) not null,
24         log_instant datetime(6) not null,
25         log_type varchar(255) not null,
26         message MEDIUMTEXT not null,
27         loop_id varchar(255) not null,
28         primary key (id)
29     ) engine=InnoDB;
30
31     create table loops (
32        name varchar(255) not null,
33         blueprint_yaml MEDIUMTEXT not null,
34         dcae_blueprint_id varchar(255),
35         dcae_deployment_id varchar(255),
36         dcae_deployment_status_url varchar(255),
37         global_properties_json json,
38         last_computed_state varchar(255) not null,
39         model_properties_json json,
40         operational_policy_schema json,
41         svg_representation MEDIUMTEXT,
42         primary key (name)
43     ) engine=InnoDB;
44
45     create table loops_microservicepolicies (
46        loop_id varchar(255) not null,
47         microservicepolicy_id varchar(255) not null,
48         primary key (loop_id, microservicepolicy_id)
49     ) engine=InnoDB;
50
51     create table micro_service_policies (
52        name varchar(255) not null,
53         json_representation json not null,
54         model_type varchar(255) not null,
55         policy_tosca MEDIUMTEXT not null,
56         properties json,
57         shared bit not null,
58         primary key (name)
59     ) engine=InnoDB;
60
61     create table operational_policies (
62        name varchar(255) not null,
63         configurations_json json,
64         loop_id varchar(255) not null,
65         primary key (name)
66     ) engine=InnoDB;
67
68     alter table loop_logs 
69        add constraint FK1j0cda46aickcaoxqoo34khg2 
70        foreign key (loop_id) 
71        references loops (name);
72
73     alter table loops_microservicepolicies 
74        add constraint FKem7tp1cdlpwe28av7ef91j1yl 
75        foreign key (microservicepolicy_id) 
76        references micro_service_policies (name);
77
78     alter table loops_microservicepolicies 
79        add constraint FKsvx91jekgdkfh34iaxtjfgebt 
80        foreign key (loop_id) 
81        references loops (name);
82
83     alter table operational_policies 
84        add constraint FK1ddoggk9ni2bnqighv6ecmuwu 
85        foreign key (loop_id) 
86        references loops (name);