[UUI] Add intent analysis and postgres deployments for uui
[oom.git] / kubernetes / uui / components / uui-intent-analysis / resources / config / intent-analysis-init.sql
1 /*
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2022 Huawei Technologies Co., Ltd.
4  *  ================================================================================
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  *
16  *  SPDX-License-Identifier: Apache-2.0
17  *  ============LICENSE_END=========================================================
18  */
19
20 CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
21
22 create table if not exists intent(
23     intent_id varchar(255) primary key,
24     intent_name varchar(255)
25 );
26
27 create table if not exists expectation(
28     expectation_id varchar(255) primary key,
29     expectation_name varchar(255),
30     expectation_type varchar(255),
31     intent_id varchar(255)
32 );
33
34 create table if not exists expectation_object(
35     object_id varchar(255) DEFAULT uuid_generate_v4 (),
36     primary key(object_id),
37     object_type varchar(255),
38     object_instance varchar(255),
39     expectation_id varchar(255)
40 );
41
42 create table if not exists expectation_target(
43     target_id varchar(255) primary key,
44     target_name varchar(255),
45     expectation_id varchar(255)
46 );
47
48 create table if not exists context(
49     context_id varchar(255) primary key,
50     context_name varchar(255),
51     parent_id varchar(255)
52 );
53
54 create table if not exists context_mapping(
55     context_id varchar(255) primary key,
56     parent_type varchar(255),
57     parent_id varchar(255)
58 );
59
60 create table if not exists fulfilment_info(
61     fulfilment_info_id varchar(255) primary key,
62     fulfilment_info_status varchar(255),
63     not_fulfilled_state varchar(255),
64     not_fulfilled_reason varchar(255)
65 );
66
67 create table if not exists state(
68     state_id varchar(255) primary key,
69     state_name varchar(255),
70     is_satisfied boolean,
71     condition varchar(255),
72     expectation_id varchar(255)
73 );
74
75 create table if not exists condition(
76     condition_id varchar(255) primary key,
77     condition_name varchar(255),
78     operator_type varchar(255),
79     condition_value varchar(255),
80     parent_id varchar(255)
81     );
82
83 create table if not exists intent_management_function_reg_info(
84     imfr_info_id varchar(255) primary key,
85     imfr_info_description varchar(255),
86     support_area varchar(255),
87     support_model varchar(255),
88     support_interfaces varchar(255),
89     handle_name varchar(255),
90     intent_function_type varchar(255)
91     );