ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/DBS/Schema/RefDBLegacy/OracleFiles.sql
(Generate patch)

Comparing COMP/DBS/Schema/RefDBLegacy/OracleFiles.sql (file contents):
Revision 1.4 by lat, Tue Oct 11 17:39:45 2005 UTC vs.
Revision 1.5 by lat, Wed Oct 19 12:54:56 2005 UTC

# Line 9 | Line 9 | create sequence seq_evcoll_file;
9   -- ======================================================================
10   create table t_block_status
11    (id                           integer         not null,
12 <   name                         varchar (1000)  not null,
13 <   created_at                   float           not null,
14 <   created_by                   integer         not null,
15 <   modified_at                  float,
16 <   modified_by                  integer);
12 >   name                         varchar (1000)  not null);
13  
14   create table t_block
15    (id                           integer         not null,
16     processed_dataset            integer         not null,
17     status                       integer         not null,
18     files                        integer         not null,
19 <   bytes                        integer         not null,
24 <   created_at                   float           not null,
25 <   created_by                   integer         not null,
26 <   modified_at                  float,
27 <   modified_by                  integer);
19 >   bytes                        integer         not null);
20  
21   create table t_file_status
22    (id                           integer         not null,
23 <   name                         varchar (1000)  not null,
32 <   created_at                   float           not null,
33 <   created_by                   integer         not null,
34 <   modified_at                  float,
35 <   modified_by                  integer);
23 >   name                         varchar (1000)  not null);
24  
25   create table t_file_type
26    (id                           integer         not null,
27 <   name                         varchar (1000)  not null,
40 <   created_at                   float           not null,
41 <   created_by                   integer         not null,
42 <   modified_at                  float,
43 <   modified_by                  integer);
27 >   name                         varchar (1000)  not null);
28  
29   create table t_file
30    (id                           integer         not null,
# Line 48 | Line 32 | create table t_file
32     logical_name                 varchar (1000)  not null,
33     checksum                     varchar (1000)  not null,
34     filesize                     integer         not null,
35 <   status                       integer         not null,
35 >   status                       integer         /* not null */,
36     type                         integer         not null,
37 <   inblock                      integer         not null,
54 <   created_at                   float           not null,
55 <   created_by                   integer         not null,
56 <   modified_at                  float,
57 <   modified_by                  integer);
37 >   inblock                      integer         not null);
38  
39   create table t_evcoll_file
40    (id                           integer         not null,
41     evcoll                       integer         not null,
42 <   fileid                       integer         not null,
63 <   created_at                   float           not null,
64 <   created_by                   integer         not null,
65 <   modified_at                  float,
66 <   modified_by                  integer);
42 >   fileid                       integer         not null);
43  
44   -- ======================================================================
45   alter table t_block_status
# Line 75 | Line 51 | alter table t_block_status
51    add constraint uq_block_status_key
52    unique (name);
53  
78 alter table t_block_status
79  add constraint fk_block_status_creatby
80  foreign key (created_by) references t_person (id);
81
82 alter table t_block_status
83  add constraint fk_block_status_modifby
84  foreign key (modified_by) references t_person (id);
85
54   --
55   alter table t_block
56    add constraint pk_block
# Line 93 | Line 61 | alter table t_block
61    add constraint fk_block_status
62    foreign key (status) references t_block_status (id);
63  
96 alter table t_block
97  add constraint fk_block_creatby
98  foreign key (created_by) references t_person (id);
99
100 alter table t_block
101  add constraint fk_block_modifby
102  foreign key (modified_by) references t_person (id);
103
64   --
65   alter table t_file_status
66    add constraint pk_file_status
# Line 111 | Line 71 | alter table t_file_status
71    add constraint uq_file_status_key
72    unique (name);
73  
114 alter table t_file_status
115  add constraint fk_file_status_creatby
116  foreign key (created_by) references t_person (id);
117
118 alter table t_file_status
119  add constraint fk_file_status_modifby
120  foreign key (modified_by) references t_person (id);
121
74   --
75   alter table t_file_type
76    add constraint pk_file_type
# Line 129 | Line 81 | alter table t_file_type
81    add constraint uq_file_type
82    unique (name);
83  
132 alter table t_file_type
133  add constraint fk_file_type_creatby
134  foreign key (created_by) references t_person (id);
135
136 alter table t_file_type
137  add constraint fk_file_type_modifby
138  foreign key (modified_by) references t_person (id);
139
84   --
85   alter table t_file
86    add constraint pk_file
# Line 159 | Line 103 | alter table t_file
103    add constraint fk_file_inblock
104    foreign key (status) references t_block (id);
105  
162 alter table t_file
163  add constraint fk_file_creatby
164  foreign key (created_by) references t_person (id);
165
166 alter table t_file
167  add constraint fk_file_modifby
168  foreign key (modified_by) references t_person (id);
169
106   --
107   alter table t_evcoll_file
108    add constraint pk_evcoll_file
# Line 186 | Line 122 | alter table t_evcoll_file
122    add constraint fk_evcoll_file_fileid
123    foreign key (fileid) references t_file (id);
124  
189 alter table t_evcoll_file
190  add constraint fk_evcoll_file_creatby
191  foreign key (created_by) references t_person (id);
192
193 alter table t_evcoll_file
194  add constraint fk_evcoll_file_modifby
195  foreign key (modified_by) references t_person (id);
196
125   -- ======================================================================
198 create index ix_block_status_creatby
199  on t_block_status (created_by)
200  tablespace CMS_DBS_INDX01;
201
202 create index ix_block_status_modifby
203  on t_block_status (modified_by)
204  tablespace CMS_DBS_INDX01;
205
206 --
126   create index ix_block_status
127    on t_block (status)
128    tablespace CMS_DBS_INDX01;
129  
211 create index ix_block_creatby
212  on t_block (created_by)
213  tablespace CMS_DBS_INDX01;
214
215 create index ix_block_modifby
216  on t_block (modified_by)
217  tablespace CMS_DBS_INDX01;
218
219 --
220 create index ix_file_status_creatby
221  on t_file_status (created_by)
222  tablespace CMS_DBS_INDX01;
223
224 create index ix_file_status_modifby
225  on t_file_status (modified_by)
226  tablespace CMS_DBS_INDX01;
227
228 --
229 create index ix_file_type_creatby
230  on t_file_type (created_by)
231  tablespace CMS_DBS_INDX01;
232
233 create index ix_file_type_modifby
234  on t_file_type (modified_by)
235  tablespace CMS_DBS_INDX01;
236
130   --
131   create index ix_file_status
132    on t_file (status)
# Line 246 | Line 139 | create index ix_file_type
139   create index ix_file_inblock
140    on t_file (inblock)
141    tablespace CMS_DBS_INDX01;
249
250 create index ix_file_creatby
251  on t_file (created_by)
252  tablespace CMS_DBS_INDX01;
253
254 create index ix_file_modifby
255  on t_file (modified_by)
256  tablespace CMS_DBS_INDX01;
257
258 --
259 create index ix_evcoll_file_creatby
260  on t_evcoll_file (created_by)
261  tablespace CMS_DBS_INDX01;
262
263 create index ix_evcoll_file_modifby
264  on t_evcoll_file (modified_by)
265  tablespace CMS_DBS_INDX01;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines