JunyiDu | e3fccd4 | 2022-09-28 16:56:13 +0800 | [diff] [blame] | 1 | -- |
| 2 | -- Copyright (C) 2022 CMCC, Inc. and others. All rights reserved. |
| 3 | -- |
| 4 | -- Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | -- you may not use this file except in compliance with the License. |
| 6 | -- You may obtain a copy of the License at |
| 7 | -- |
| 8 | -- http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | -- |
| 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 | |
| 17 | -- ---------------------------- |
| 18 | -- Table structure for "alarms_additionalinformation" |
| 19 | -- ---------------------------- |
| 20 | DROP TABLE IF EXISTS alarms_additionalinformation; |
| 21 | CREATE TABLE alarms_additionalinformation( |
| 22 | id serial, |
| 23 | "header_id" varchar(50) NOT NULL, |
| 24 | "name" varchar(100) DEFAULT NULL, |
| 25 | "value" varchar(100) DEFAULT NULL, |
| 26 | "source_id" varchar(100) DEFAULT NULL, |
| 27 | "start_epoch_microsec" varchar(100) DEFAULT NULL, |
| 28 | "last_epoch_microsec" varchar(100) DEFAULT NULL, |
| 29 | CONSTRAINT alarms_additionalinformation_pk PRIMARY KEY (id) |
| 30 | ) WITH ( OIDS = FALSE); |
| 31 | |
| 32 | -- ---------------------------- |
| 33 | -- Table structure for "alarms_commoneventheader" |
| 34 | -- ---------------------------- |
| 35 | DROP TABLE IF EXISTS alarms_commoneventheader; |
| 36 | CREATE TABLE alarms_commoneventheader ( |
| 37 | "id" varchar(50) NOT NULL, |
| 38 | "version" varchar(100) DEFAULT NULL, |
| 39 | "event_name" varchar(100) DEFAULT NULL, |
| 40 | "domain" varchar(100) DEFAULT NULL, |
| 41 | "event_id" varchar(100) DEFAULT NULL, |
| 42 | "event_type" varchar(100) DEFAULT NULL, |
| 43 | "nfc_naming_code" varchar(100) DEFAULT NULL, |
| 44 | "nf_naming_code" varchar(100) DEFAULT NULL, |
| 45 | "source_id" varchar(100) DEFAULT NULL, |
| 46 | "source_name" varchar(100) DEFAULT NULL, |
| 47 | "reporting_entity_id" varchar(100) DEFAULT NULL, |
| 48 | "reporting_entity_name" varchar(100) DEFAULT NULL, |
| 49 | "priority" varchar(50) DEFAULT NULL, |
| 50 | "start_epoch_microsec" varchar(100) DEFAULT NULL, |
| 51 | "last_epoch_microsec" varchar(100) DEFAULT NULL, |
| 52 | "start_epoch_microsec_cleared" varchar(100) DEFAULT NULL, |
| 53 | "last_epoch_microsec_cleared" varchar(100) DEFAULT NULL, |
| 54 | "sequence" varchar(100) DEFAULT NULL, |
| 55 | "fault_fields_version" varchar(100) DEFAULT NULL, |
| 56 | "event_servrity" varchar(100) DEFAULT NULL, |
| 57 | "event_source_type" varchar(100) DEFAULT NULL, |
| 58 | "event_category" varchar(100) DEFAULT NULL, |
| 59 | "alarm_condition" varchar(100) DEFAULT NULL, |
| 60 | "specific_problem" varchar(100) DEFAULT NULL, |
| 61 | "vf_status" varchar(100) DEFAULT NULL, |
| 62 | "alarm_interfacea" varchar(100) DEFAULT NULL, |
| 63 | "status" varchar(50) DEFAULT NULL, |
| 64 | CONSTRAINT alarms_commoneventheader_pk PRIMARY KEY (id) |
| 65 | ) WITH ( OIDS = FALSE ); |
| 66 | |
| 67 | -- ---------------------------- |
| 68 | -- Table structure for "performance_additionalinformation" |
| 69 | -- ---------------------------- |
| 70 | DROP TABLE IF EXISTS performance_additionalinformation; |
| 71 | CREATE TABLE performance_additionalinformation ( |
| 72 | id serial, |
| 73 | "header_id" varchar(50) NOT NULL, |
| 74 | "name" varchar(100) DEFAULT NULL, |
| 75 | "value" varchar(100) DEFAULT NULL, |
| 76 | "source_id" varchar(100) DEFAULT NULL, |
| 77 | "start_epoch_microsec" varchar(100) DEFAULT NULL, |
| 78 | "last_epoch_microsec" varchar(100) DEFAULT NULL, |
| 79 | CONSTRAINT performance_additionalinformation_pk PRIMARY KEY (id) |
| 80 | ) WITH ( OIDS = FALSE ); |
| 81 | |
| 82 | -- ---------------------------- |
| 83 | -- Table structure for "performance_commoneventheader" |
| 84 | -- ---------------------------- |
| 85 | DROP TABLE IF EXISTS performance_commoneventheader; |
| 86 | CREATE TABLE performance_commoneventheader ( |
| 87 | "id" varchar(50) NOT NULL, |
| 88 | "version" varchar(100) DEFAULT NULL, |
| 89 | "event_name" varchar(100) DEFAULT NULL, |
| 90 | "domain" varchar(100) DEFAULT NULL, |
| 91 | "event_id" varchar(100) DEFAULT NULL, |
| 92 | "event_type" varchar(100) DEFAULT NULL, |
| 93 | "nfc_naming_code" varchar(100) DEFAULT NULL, |
| 94 | "nf_namingcode" varchar(100) DEFAULT NULL, |
| 95 | "source_id" varchar(100) DEFAULT NULL, |
| 96 | "source_name" varchar(100) DEFAULT NULL, |
| 97 | "reporting_entity_id" varchar(100) DEFAULT NULL, |
| 98 | "reporting_entity_name" varchar(100) DEFAULT NULL, |
| 99 | "priority" varchar(50) DEFAULT NULL, |
| 100 | "start_epoch_microsec" varchar(100) DEFAULT NULL, |
| 101 | "last_epoch_microsec" varchar(100) DEFAULT NULL, |
| 102 | "sequence" varchar(100) DEFAULT NULL, |
| 103 | "measurements_for_vf_scaling_version" varchar(100) DEFAULT NULL, |
| 104 | "measurement_interval" varchar(100) DEFAULT NULL, |
| 105 | CONSTRAINT performance_commoneventheader_pk PRIMARY KEY (id) |
| 106 | ) WITH (OIDS = FALSE); |
| 107 | |
| 108 | -- ---------------------------- |
| 109 | -- Table structure for service_instances |
| 110 | -- ---------------------------- |
| 111 | DROP TABLE IF EXISTS service_instances; |
| 112 | CREATE TABLE service_instances ( |
| 113 | "id" varchar(50) NOT NULL, |
| 114 | "service_instance_id" varchar(100) NOT NULL, |
| 115 | "customer_id" varchar(50) NOT NULL, |
| 116 | "service_type" varchar(50) NOT NULL, |
| 117 | "usecase_type" varchar(50) NOT NULL, |
| 118 | "uuid" varchar(100), |
| 119 | "invariant_uuid" varchar(100), |
| 120 | CONSTRAINT service_instances_pk PRIMARY KEY (service_instance_id) |
| 121 | ); |
| 122 | |
| 123 | -- ---------------------------- |
| 124 | -- Table structure for service_instance_operations |
| 125 | -- ---------------------------- |
| 126 | DROP TABLE IF EXISTS service_instance_operations; |
| 127 | CREATE TABLE service_instance_operations ( |
| 128 | "service_instance_id" varchar(100) NOT NULL, |
| 129 | "operation_id" varchar(100) NOT NULL, |
| 130 | "operation_type" varchar(50) NOT NULL, |
| 131 | "operation_progress" varchar(50) NOT NULL, |
| 132 | "operation_result" varchar(100) DEFAULT NULL, |
| 133 | "start_time" varchar(100) NOT NULL, |
| 134 | "end_time" varchar(100), |
| 135 | CONSTRAINT service_instance_operations_pk PRIMARY KEY (service_instance_id, operation_id) |
| 136 | ); |
| 137 | |
| 138 | -- ---------------------------- |
| 139 | -- Table structure for sort_master |
| 140 | -- ---------------------------- |
| 141 | DROP TABLE IF EXISTS sort_master; |
| 142 | CREATE TABLE sort_master ( |
| 143 | "sort_type" varchar(50) NOT NULL, |
| 144 | "sort_code" varchar(10) NOT NULL, |
| 145 | "sort_value" varchar(100) NOT NULL, |
| 146 | "language" varchar(50) NOT NULL, |
| 147 | CONSTRAINT sort_master_pk PRIMARY KEY (sort_type, sort_code, language) |
| 148 | ); |
| 149 | |
| 150 | -- ---------------------------- |
| 151 | -- Table structure for sort_master |
| 152 | -- ---------------------------- |
| 153 | DROP TABLE IF EXISTS instance_performance; |
| 154 | CREATE TABLE instance_performance |
| 155 | ( |
| 156 | id serial not null |
| 157 | constraint instance_performance_pk |
| 158 | primary key, |
| 159 | job_id varchar(36), |
| 160 | resource_instance_id varchar(36), |
| 161 | bandwidth numeric, |
| 162 | date timestamp, |
| 163 | max_bandwidth numeric |
| 164 | ); |
| 165 | |
| 166 | -- ---------------------------- |
| 167 | -- Table structure for ccvpn_instance |
| 168 | -- ---------------------------- |
| 169 | DROP TABLE IF EXISTS ccvpn_instance; |
| 170 | CREATE TABLE ccvpn_instance |
| 171 | ( |
| 172 | id serial not null |
| 173 | constraint ccvpn_instance_pk |
| 174 | primary key, |
| 175 | instance_id varchar(16), |
| 176 | job_id varchar(36), |
| 177 | progress integer, |
| 178 | status char default 0, |
| 179 | resource_instance_id varchar(36), |
| 180 | name varchar(255), |
| 181 | cloud_point_name varchar(255), |
| 182 | access_point_one_name varchar(255), |
| 183 | access_point_one_band_width integer, |
| 184 | line_num varchar(64), |
| 185 | delete_state integer default 0, |
| 186 | protect_status integer default 0, |
| 187 | protection_cloud_point_name varchar(255), |
| 188 | protection_type varchar(255) |
| 189 | ); |
| 190 | |
| 191 | -- ---------------------------- |
| 192 | -- Table structure for intent_model |
| 193 | -- ---------------------------- |
| 194 | DROP TABLE IF EXISTS intent_model; |
| 195 | create table intent_model |
| 196 | ( |
| 197 | id serial not null |
| 198 | constraint intent_model_pk |
| 199 | primary key, |
| 200 | model_name varchar(100) default NULL::character varying, |
| 201 | file_path varchar(500) default NULL::character varying, |
| 202 | create_time varchar(100) default NULL::character varying, |
| 203 | size numeric(10, 3), |
| 204 | active integer, |
| 205 | model_type integer default 0 |
| 206 | ); |
| 207 | |
| 208 | -- ---------------------------- |
| 209 | -- Table structure for intent_instance |
| 210 | -- ---------------------------- |
| 211 | DROP TABLE IF EXISTS intent_instance; |
| 212 | create table intent_instance |
| 213 | ( |
| 214 | id serial not null |
| 215 | constraint intent_instance_pk |
| 216 | primary key, |
| 217 | intent_name varchar(50), |
| 218 | intent_source integer, |
| 219 | customer varchar(50), |
| 220 | intent_content text, |
| 221 | intent_config text, |
| 222 | business_instance_id varchar(50), |
| 223 | business_instance varchar(255) |
| 224 | ); |
| 225 | |
| 226 | -- ---------------------------- |
| 227 | -- import initial data for sort_master |
| 228 | -- ---------------------------- |
| 229 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationType', '1001', 'Creating', 'en'); |
| 230 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationType', '1002', 'Deleting', 'en'); |
| 231 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationType', '1003', 'Scaling', 'en'); |
| 232 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationType', '1004', 'Healing', 'en'); |
| 233 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationType', '1005', 'Updating', 'en'); |
| 234 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationType', '1001', '创建', 'cn'); |
| 235 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationType', '1002', '删除', 'cn'); |
| 236 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationType', '1003', '缩扩容', 'cn'); |
| 237 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationType', '1004', '自愈', 'cn'); |
| 238 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationType', '1005', '更新', 'cn'); |
| 239 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationResult', '2001', 'Successful', 'en'); |
| 240 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationResult', '2002', 'Failed', 'en'); |
| 241 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationResult', '2003', 'In Progress', 'en'); |
| 242 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationResult', '2001', '成功', 'cn'); |
| 243 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationResult', '2002', '失败', 'cn'); |
| 244 | INSERT INTO sort_master (sort_type, sort_code, sort_value, language) VALUES ('operationResult', '2003', '执行中', 'cn'); |
| 245 | |