onap on kubernetes source files
[oom.git] / kubernetes / config / docker / init / src / config / mso / mariadb / docker-entrypoint-initdb.d / db-sql-scripts / main-schemas / MySQL-Catalog-schema.sql
1
2     alter table HEAT_TEMPLATE 
3         drop 
4         foreign key FK_ek5sot1q07taorbdmkvnveu98;
5
6     alter table HEAT_TEMPLATE_PARAMS 
7         drop 
8         foreign key FK_8sxvm215cw3tjfh3wni2y3myx;
9
10     alter table SERVICE_RECIPE 
11         drop 
12         foreign key FK_kv13yx013qtqkn94d5gkwbu3s;
13
14     drop table if exists HEAT_ENVIRONMENT;
15
16     drop table if exists HEAT_FILES;
17
18     drop table if exists HEAT_NESTED_TEMPLATE;
19
20     drop table if exists HEAT_TEMPLATE;
21
22     drop table if exists HEAT_TEMPLATE_PARAMS;
23
24     drop table if exists NETWORK_RECIPE;
25
26     drop table if exists NETWORK_RESOURCE;
27
28     drop table if exists SERVICE;
29
30     drop table if exists SERVICE_RECIPE;
31
32     drop table if exists VF_MODULE;
33
34     drop table if exists VF_MODULE_TO_HEAT_FILES;
35
36     drop table if exists VNF_COMPONENTS;
37
38     drop table if exists VNF_COMPONENTS_RECIPE;
39
40     drop table if exists VNF_RECIPE;
41
42     drop table if exists VNF_RESOURCE;
43
44     create table HEAT_ENVIRONMENT (
45         id integer not null auto_increment,
46         NAME varchar(100) not null,
47         VERSION varchar(20) not null,
48         ASDC_RESOURCE_NAME varchar(100) default 'MANUAL RECORD' not null,
49         DESCRIPTION varchar(1200),
50         ENVIRONMENT longtext not null,
51         CREATION_TIMESTAMP datetime not null,
52         ASDC_UUID varchar(200) default 'MANUAL RECORD',
53         ASDC_LABEL varchar(200),
54         primary key (id)
55     );
56
57     create table HEAT_FILES (
58         id integer not null auto_increment,
59         FILE_NAME varchar(200) not null,
60         ASDC_RESOURCE_NAME varchar(100) not null,
61         VERSION varchar(20) not null,
62         VNF_RESOURCE_ID integer,
63         DESCRIPTION varchar(1200),
64         FILE_BODY longtext not null,
65         CREATION_TIMESTAMP datetime not null,
66         ASDC_UUID varchar(200),
67         ASDC_LABEL varchar(200),
68         primary key (id)
69     );
70
71     create table HEAT_NESTED_TEMPLATE (
72         PARENT_TEMPLATE_ID integer not null,
73         CHILD_TEMPLATE_ID integer not null,
74         PROVIDER_RESOURCE_FILE varchar(100),
75         primary key (PARENT_TEMPLATE_ID, CHILD_TEMPLATE_ID)
76     );
77
78     create table HEAT_TEMPLATE (
79         id integer not null auto_increment,
80         TEMPLATE_NAME varchar(200) not null,
81         VERSION varchar(20) not null,
82         ASDC_RESOURCE_NAME varchar(100) default 'MANUAL RECORD' not null,
83         TEMPLATE_PATH varchar(100),
84         TEMPLATE_BODY longtext not null,
85         TIMEOUT_MINUTES integer,
86         ASDC_UUID varchar(200) default 'MANUAL RECORD' not null,
87         DESCRIPTION varchar(1200),
88         ASDC_LABEL varchar(200),
89         CREATION_TIMESTAMP datetime not null,
90         CHILD_TEMPLATE_ID integer,
91         primary key (id)
92     );
93
94     create table HEAT_TEMPLATE_PARAMS (
95         id integer not null auto_increment,
96         HEAT_TEMPLATE_ID integer not null,
97         PARAM_NAME varchar(100) not null,
98         IS_REQUIRED bit not null,
99         PARAM_TYPE varchar(20),
100         PARAM_ALIAS varchar(45),
101         primary key (id)
102     );
103
104     create table NETWORK_RECIPE (
105         id integer not null auto_increment,
106         NETWORK_TYPE varchar(20) not null,
107         ACTION varchar(20) not null,
108         VERSION_STR varchar(20) not null,
109         SERVICE_TYPE varchar(45),
110         DESCRIPTION varchar(1200),
111         ORCHESTRATION_URI varchar(256) not null,
112         NETWORK_PARAM_XSD varchar(2048),
113         RECIPE_TIMEOUT integer,
114         CREATION_TIMESTAMP datetime not null,
115         primary key (id)
116     );
117
118     create table NETWORK_RESOURCE (
119         id integer not null,
120         NETWORK_TYPE varchar(45) not null,
121         VERSION_STR varchar(20) not null,
122         ORCHESTRATION_MODE varchar(20),
123         DESCRIPTION varchar(1200),
124         TEMPLATE_ID integer,
125         CREATION_TIMESTAMP datetime not null,
126         AIC_VERSION_MIN varchar(20) default 2.5,
127         AIC_VERSION_MAX varchar(20) default 2.5,
128         NEUTRON_NETWORK_TYPE varchar(20),
129         primary key (id)
130     );
131
132     create table SERVICE (
133         id integer not null auto_increment,
134         SERVICE_NAME varchar(40),
135         VERSION_STR varchar(20),
136         DESCRIPTION varchar(1200),
137         SERVICE_NAME_VERSION_ID varchar(50),
138         SERVICE_VERSION varchar(10),
139         HTTP_METHOD varchar(50),
140         CREATION_TIMESTAMP datetime not null,
141         MODEL_INVARIANT_UUID varchar(200) default 'MANUAL_RECORD' not null,
142         primary key (id)
143     );
144
145     create table SERVICE_RECIPE (
146         id integer not null auto_increment,
147         SERVICE_ID integer not null,
148         ACTION varchar(40) not null,
149         VERSION_STR varchar(20),
150         DESCRIPTION varchar(1200),
151         ORCHESTRATION_URI varchar(256) not null,
152         SERVICE_PARAM_XSD varchar(2048),
153         RECIPE_TIMEOUT integer,
154         SERVICE_TIMEOUT_INTERIM integer,
155         CREATION_TIMESTAMP datetime not null,
156         primary key (id)
157     );
158
159     create table VF_MODULE (
160         id integer not null auto_increment,
161         TYPE varchar(200) not null,
162         ASDC_SERVICE_MODEL_VERSION varchar(20) not null,
163         MODEL_NAME varchar(200) not null,
164         MODEL_VERSION varchar(20) not null,
165         ASDC_UUID varchar(255),
166         VOL_ENVIRONMENT_ID integer,
167         TEMPLATE_ID integer,
168         IS_BASE integer not null,
169         CREATION_TIMESTAMP datetime not null,
170         DESCRIPTION varchar(255),
171         VOL_TEMPLATE_ID integer,
172         VNF_RESOURCE_ID integer not null,
173         ENVIRONMENT_ID integer,
174         MODEL_INVARIANT_UUID varchar(255),
175         primary key (id)
176     );
177
178     create table VF_MODULE_TO_HEAT_FILES (
179         VF_MODULE_ID integer not null,
180         HEAT_FILES_ID integer not null,
181         primary key (VF_MODULE_ID, HEAT_FILES_ID)
182     );
183
184     create table VNF_COMPONENTS (
185         VNF_ID integer not null,
186         COMPONENT_TYPE varchar(20) not null,
187         HEAT_TEMPLATE_ID integer,
188         HEAT_ENVIRONMENT_ID integer,
189         CREATION_TIMESTAMP datetime not null,
190         primary key (VNF_ID, COMPONENT_TYPE)
191     );
192
193     create table VNF_COMPONENTS_RECIPE (
194         id integer not null auto_increment,
195         VNF_TYPE varchar(200),
196         VF_MODULE_ID varchar(100),
197         VNF_COMPONENT_TYPE varchar(45) not null,
198         ACTION varchar(20) not null,
199         SERVICE_TYPE varchar(45),
200         VERSION varchar(20),
201         DESCRIPTION varchar(1200),
202         ORCHESTRATION_URI varchar(256) not null,
203         VNF_COMPONENT_PARAM_XSD varchar(2048),
204         RECIPE_TIMEOUT integer,
205         CREATION_TIMESTAMP datetime,
206         primary key (id)
207     );
208
209     create table VNF_RECIPE (
210         id integer not null auto_increment,
211         VF_MODULE_ID varchar(100),
212         ACTION varchar(20) not null,
213         VERSION_STR varchar(20) not null,
214         VNF_TYPE varchar(200),
215         SERVICE_TYPE varchar(45),
216         DESCRIPTION varchar(1200),
217         ORCHESTRATION_URI varchar(256) not null,
218         VNF_PARAM_XSD varchar(2048),
219         RECIPE_TIMEOUT integer,
220         CREATION_TIMESTAMP datetime,
221         primary key (id)
222     );
223
224     create table VNF_RESOURCE (
225         id integer not null auto_increment,
226         VNF_TYPE varchar(200) not null,
227         ASDC_SERVICE_MODEL_VERSION varchar(20) not null,
228         ORCHESTRATION_MODE varchar(20) not null,
229         DESCRIPTION varchar(1200),
230         TEMPLATE_ID integer,
231         ENVIRONMENT_ID integer,
232         CREATION_TIMESTAMP datetime not null,
233         ASDC_UUID varchar(200),
234         AIC_VERSION_MIN varchar(20),
235         AIC_VERSION_MAX varchar(20),
236         MODEL_INVARIANT_UUID varchar(200),
237         MODEL_VERSION varchar(20) not null,
238         MODEL_CUSTOMIZATION_NAME varchar(200),
239         MODEL_NAME varchar(200),
240         SERVICE_MODEL_INVARIANT_UUID varchar(200),
241         primary key (id)
242     );
243
244     alter table HEAT_ENVIRONMENT 
245         add constraint UK_a4jkta7hgpa99brceaxasnfqp  unique (NAME, VERSION, ASDC_RESOURCE_NAME);
246
247     alter table HEAT_FILES 
248         add constraint UK_m23vfqc1tdvj7d6f0jjo4cl7e  unique (FILE_NAME, ASDC_RESOURCE_NAME, VERSION);
249
250     alter table HEAT_TEMPLATE 
251         add constraint UK_k1tq7vblss8ykiwhiltnkg6no  unique (TEMPLATE_NAME, VERSION, ASDC_RESOURCE_NAME);
252
253     alter table HEAT_TEMPLATE_PARAMS 
254         add constraint UK_pj3cwbmewecf0joqv2mvmbvw3  unique (HEAT_TEMPLATE_ID, PARAM_NAME);
255
256     alter table NETWORK_RECIPE 
257         add constraint UK_rl4f296i0p8lyokxveaiwkayi  unique (NETWORK_TYPE, ACTION, VERSION_STR);
258
259     alter table NETWORK_RESOURCE 
260         add constraint UK_i4hpdnu3rmdsit3m6fw1ynguq  unique (NETWORK_TYPE, VERSION_STR);
261
262     alter table SERVICE_RECIPE 
263         add constraint UK_7fav5dkux2v8g9d2i5ymudlgc  unique (SERVICE_ID, ACTION);
264
265     alter table VF_MODULE 
266         add constraint UK_o3bvdqspginaxlp4gxqohd44l  unique (TYPE, ASDC_SERVICE_MODEL_VERSION);
267
268     alter table VNF_COMPONENTS_RECIPE 
269         add constraint UK_4dpdwddaaclhc11wxsb7h59ma  unique (VNF_TYPE, VF_MODULE_ID, VNF_COMPONENT_TYPE, ACTION, SERVICE_TYPE, VERSION);
270
271     alter table VNF_RECIPE 
272         add constraint UK_f3tvqau498vrifq3cr8qnigkr  unique (VF_MODULE_ID, ACTION, VERSION_STR);
273
274     alter table VNF_RESOURCE 
275         add constraint UK_k10a0w7h4t0lnbynd3inkg67k  unique (VNF_TYPE, ASDC_SERVICE_MODEL_VERSION);
276
277     alter table HEAT_TEMPLATE 
278         add constraint FK_ek5sot1q07taorbdmkvnveu98 
279         foreign key (CHILD_TEMPLATE_ID) 
280         references HEAT_TEMPLATE (id);
281
282     alter table HEAT_TEMPLATE_PARAMS 
283         add constraint FK_8sxvm215cw3tjfh3wni2y3myx 
284         foreign key (HEAT_TEMPLATE_ID) 
285         references HEAT_TEMPLATE (id);
286
287     alter table SERVICE_RECIPE 
288         add constraint FK_kv13yx013qtqkn94d5gkwbu3s 
289         foreign key (SERVICE_ID) 
290         references SERVICE (id);