1 |
-- ======================================================================
|
2 |
create sequence seq_app_family;
|
3 |
create sequence seq_application;
|
4 |
create sequence seq_app_config;
|
5 |
|
6 |
-- ======================================================================
|
7 |
create table t_app_family
|
8 |
(id integer not null,
|
9 |
name varchar (1000) not null);
|
10 |
|
11 |
create table t_application
|
12 |
(id integer not null,
|
13 |
executable varchar (1000) not null,
|
14 |
app_version varchar (1000) not null,
|
15 |
app_family integer not null);
|
16 |
|
17 |
create table t_app_config
|
18 |
(id integer not null,
|
19 |
application integer not null,
|
20 |
parameter_set varchar (1000) not null);
|
21 |
|
22 |
-- ======================================================================
|
23 |
alter table t_app_family
|
24 |
add constraint pk_app_family
|
25 |
primary key (id)
|
26 |
using index tablespace CMS_DBS_INDX01;
|
27 |
|
28 |
alter table t_app_family
|
29 |
add constraint uq_app_family_name
|
30 |
unique (name);
|
31 |
|
32 |
--
|
33 |
alter table t_application
|
34 |
add constraint pk_application
|
35 |
primary key (id)
|
36 |
using index tablespace CMS_DBS_INDX01;
|
37 |
|
38 |
alter table t_application
|
39 |
add constraint uq_application_key
|
40 |
unique (executable, app_version, app_family);
|
41 |
|
42 |
alter table t_application
|
43 |
add constraint fk_app_family
|
44 |
foreign key (app_family) references t_app_family (id);
|
45 |
|
46 |
--
|
47 |
alter table t_app_config
|
48 |
add constraint pk_app_config
|
49 |
primary key (id)
|
50 |
using index tablespace CMS_DBS_INDX01;
|
51 |
|
52 |
alter table t_app_config
|
53 |
add constraint uq_app_config
|
54 |
unique (application, parameter_set);
|
55 |
|
56 |
alter table t_app_config
|
57 |
add constraint fk_app_config_app
|
58 |
foreign key (application) references t_application (id);
|