DMAAP-83 Initial code import
[dmaap/dbcapi.git] / src / main / resources / schema_1.sql
1 ---
2 -- ============LICENSE_START=======================================================
3 -- OpenECOMP - org.openecomp.dmaapbc
4 -- ================================================================================
5 -- Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 -- ================================================================================
7 -- Licensed under the Apache License, Version 2.0 (the "License");
8 -- you may not use this file except in compliance with the License.
9 -- You may obtain a copy of the License at
10 -- 
11 --      http://www.apache.org/licenses/LICENSE-2.0
12 -- 
13 -- Unless required by applicable law or agreed to in writing, software
14 -- distributed under the License is distributed on an "AS IS" BASIS,
15 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 -- See the License for the specific language governing permissions and
17 -- limitations under the License.
18 -- ============LICENSE_END=========================================================
19 ---
20
21 @drop table dcae_location;
22 create table dcae_location      (
23         dcae_location_name      VARCHAR(100),
24         clli    VARCHAR(100),
25         dcae_layer      VARCHAR(100),
26         open_stack_availability_zone    VARCHAR(100),
27         last_mod        TIMESTAMP,
28         PRIMARY KEY(dcae_location_name)
29 );
30 @drop table dmaap;
31 create table dmaap      (
32         version VARCHAR(100),
33         topic_ns_root   VARCHAR(100),
34         dmaap_name      VARCHAR(100),
35         dr_prov_url     VARCHAR(200),
36         node_key        VARCHAR(100),
37         access_key_owner        VARCHAR(100),
38         last_mod        TIMESTAMP,
39         status          VARCHAR(100),
40         bridge_admin_topic      VARCHAR(100),
41         logging_url     VARCHAR(200)
42 );
43 @drop table dr_node;
44 create table dr_node    (
45         fqdn    VARCHAR(100),
46         dcae_location_name      VARCHAR(100),
47         host_name       VARCHAR(100),
48         version VARCHAR(100),
49         PRIMARY KEY(fqdn)
50 );
51 @drop table dr_pub;
52 create table dr_pub     (
53         dcae_location_name      VARCHAR(100),
54         username        VARCHAR(100),
55         userpwd VARCHAR(100),
56         feed_id VARCHAR(100),
57         pub_id  VARCHAR(100),
58         status  VARCHAR(100),
59         PRIMARY KEY(pub_id)
60 );
61 @drop table dr_sub;
62 create table dr_sub     (
63         owner   VARCHAR(100),
64         suspended       BOOLEAN,
65         status  VARCHAR(100),
66         use100  BOOLEAN,
67         dcae_location_name      VARCHAR(100),
68         username        VARCHAR(100),
69         userpwd VARCHAR(100),
70         feed_id VARCHAR(100),
71         delivery_u_r_l  VARCHAR(200),
72         log_u_r_l       VARCHAR(200),
73         sub_id  VARCHAR(100),
74         PRIMARY KEY(sub_id)
75 );
76 @drop table mr_client;
77 create table mr_client  (
78         dcae_location_name      VARCHAR(100),
79         fqtn    VARCHAR(100),
80         client_role     VARCHAR(100),
81         action  VARCHAR(300),
82         mr_client_id    VARCHAR(100),
83         status  VARCHAR(100),
84         topic_u_r_l     VARCHAR(200),
85         last_mod        TIMESTAMP,
86         PRIMARY KEY(mr_client_id)
87 );
88 @drop table mr_cluster;
89 create table mr_cluster (
90         last_mod        TIMESTAMP,
91         dcae_location_name      VARCHAR(100),
92         fqdn    VARCHAR(100),
93         hosts   VARCHAR(300),
94         topic_protocol  VARCHAR(100),
95         topic_port      VARCHAR(100),
96         PRIMARY KEY(dcae_location_name)
97 );
98 @drop table feed;
99 create table feed       (
100         suspended       BOOLEAN,
101         subscribe_u_r_l VARCHAR(200),
102         feed_id VARCHAR(100),
103         feed_name       VARCHAR(100),
104         feed_version    VARCHAR(100),
105         feed_description        VARCHAR(1000),
106         owner   VARCHAR(100),
107         aspr_classification     VARCHAR(100),
108         publish_u_r_l   VARCHAR(200),
109         log_u_r_l       VARCHAR(200),
110         status  VARCHAR(100),
111         -- pubs not stored here
112         -- subs not stored here
113         PRIMARY KEY(feed_id)
114 );
115 @drop table topic;
116 create table topic      (
117         last_mod        TIMESTAMP,
118         fqtn    VARCHAR(100),
119         topic_name      VARCHAR(100),
120         topic_description       VARCHAR(1000),
121         tnx_enabled     VARCHAR(100),
122         owner   VARCHAR(100),
123         status  VARCHAR(100),
124         -- clients not stored here
125         PRIMARY KEY(fqtn)
126 );
127 @drop table mirror_maker;
128 create table mirror_maker       (
129         mm_name VARCHAR(100),
130         source_cluster  VARCHAR(100),
131         target_cluster  VARCHAR(100),
132         last_mod        TIMESTAMP,
133         vectors         TEXT,
134         PRIMARY KEY(source_cluster)
135 );
136 update dmaapbc_sch_ver set version = 1 where version = 0;