-
Notifications
You must be signed in to change notification settings - Fork 30
/
01-CONFIGURATION-DDL.sql
41 lines (33 loc) · 1.58 KB
/
01-CONFIGURATION-DDL.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
CREATE SCHEMA CONFIGURATION;
CREATE SEQUENCE CONFIGURATION.SQ_NM_ID_EXPOSURE_CONFIGURATION;
CREATE SEQUENCE CONFIGURATION.SQ_NM_ID_GENERAL_CONFIGURATION;
CREATE TABLE CONFIGURATION.EXPOSURE_CONFIGURATION (
NM_ID_CONFIGURATION INTEGER DEFAULT nextval('CONFIGURATION.SQ_NM_ID_EXPOSURE_CONFIGURATION'),
NM_ID_CONFIGURATION_TYPE SMALLINT,
NM_LEVEL_VALUE_1 SMALLINT,
NM_LEVEL_VALUE_2 SMALLINT,
NM_LEVEL_VALUE_3 SMALLINT,
NM_LEVEL_VALUE_4 SMALLINT,
NM_LEVEL_VALUE_5 SMALLINT,
NM_LEVEL_VALUE_6 SMALLINT,
NM_LEVEL_VALUE_7 SMALLINT,
NM_LEVEL_VALUE_8 SMALLINT,
NM_RISK_WEIGHT NUMERIC(5,2),
CONSTRAINT PK_EXPOSURE_CONFIGURATION
PRIMARY KEY (NM_ID_CONFIGURATION)
);
CREATE TABLE CONFIGURATION.GENERAL_CONFIGURATION (
NM_ID_GEN_CONFIGURATION INTEGER DEFAULT nextval('CONFIGURATION.SQ_NM_ID_GENERAL_CONFIGURATION'),
NM_ID_GEN_CONFIGURATION_TYPE SMALLINT,
NM_ID_GEN_VALUE_TYPE SMALLINT,
DE_LABEL CHAR VARYING(200),
DE_VALUE CHAR VARYING(200),
DE_MIN_VALUE CHAR VARYING(200),
DE_MAX_VALUE CHAR VARYING(200),
CONSTRAINT PK_GENERAL_CONFIGURATION
PRIMARY KEY (NM_ID_GEN_CONFIGURATION)
);
ALTER SEQUENCE CONFIGURATION.SQ_NM_ID_EXPOSURE_CONFIGURATION
OWNED BY CONFIGURATION.EXPOSURE_CONFIGURATION.NM_ID_CONFIGURATION;
ALTER SEQUENCE CONFIGURATION.SQ_NM_ID_GENERAL_CONFIGURATION
OWNED BY CONFIGURATION.GENERAL_CONFIGURATION.NM_ID_GEN_CONFIGURATION;