-- Licensed Materials - Property of IBM
-- 5724-I68
--
-- (C) Copyright IBM Corp. 2000, 2006
--
-- US Government Users Restricted Rights - Use, duplication, or
-- disclosure restricted by GSA ADP Schedule Contract with IBM Corp.



update command options using c off;

-- ===================================================================
--
-- Table tdoc_dbl_doc_blob
--
-- Contains the content of a document
-- ===================================================================

drop table tdoc_dbl_doc_blob;
create table tdoc_dbl_doc_blob
( 
    dbl_cmp_id                    bigint,
    dbl_doc_id                    bigint,
    dbl_blob                      blob (1G)
) 

in blob_tbl_data index in indx;


drop synonym dbl;
create synonym dbl for tdoc_dbl_doc_blob;

drop sequence qdoc_dbl_doc_id restrict;
create sequence qdoc_dbl_doc_id start with 1 increment by 200 nocache;

-- ===================================================================
--
-- Table tdoc_dhi_doc_hierarchy
--
-- Contains the path of a document
-- ===================================================================

drop table tdoc_dhi_doc_hierarchy;
create table tdoc_dhi_doc_hierarchy
( 
    dhi_cmp_id                    bigint not null,
    dhi_doc_id                    bigint,
    dhi_doc_path                  varchar(1000) not null,
    dhi_doc_real_path             varchar(1000),
    dhi_object_group_id           bigint,
    dhi_system_doc                varchar(30),
    constraint dhi_0_uk
        unique (dhi_doc_path, dhi_cmp_id)
) 

in users index in indx;


drop synonym dhi;
create synonym dhi for tdoc_dhi_doc_hierarchy;

-- ===================================================================
--
-- Table tdoc_doa_doc_attributes
--
-- Contains the attributes of a document
-- ===================================================================

drop table tdoc_doa_doc_attributes;
create table tdoc_doa_doc_attributes
( 
    doa_cmp_id                    bigint not null,
    doa_doc_id                    bigint not null,
    doa_name                      varchar(128) not null,
    doa_value                     varchar(3000),
    constraint doa_0_uk
        unique (doa_doc_id, doa_cmp_id, doa_name)
) 

in users index in indx;


drop synonym doa;
create synonym doa for tdoc_doa_doc_attributes;

-- ===================================================================
--
-- Table tdoc_dad_docstore_audit
--
-- Contains the audit info for files in the docstore
-- ===================================================================

drop table tdoc_dad_docstore_audit;
create table tdoc_dad_docstore_audit
( 
    dad_cmp_id                    bigint,
    dad_user_id                   bigint,
    dad_doc_path                  varchar(1000),
    dad_type                      varchar(128),
    dad_date                      timestamp
) 

in users index in indx;


drop synonym dad;
create synonym dad for tdoc_dad_docstore_audit;

-- ===================================================================
--
-- Table tdoc_sta_staging_area
--
-- Staging area info
-- ===================================================================

drop table tdoc_sta_staging_area;
create table tdoc_sta_staging_area
( 
    sta_cmp_id                    bigint not null,
    sta_id                        bigint,
    sta_name                      varchar(1000) not null,
    constraint sta_0_pk
        primary key (sta_cmp_id, sta_name)
) 

in users index in indx;


drop synonym sta;
create synonym sta for tdoc_sta_staging_area;

drop sequence qdoc_sta_id restrict;
create sequence qdoc_sta_id start with 1 increment by 200 nocache;

drop sequence qdoc_file_id restrict;
create sequence qdoc_file_id start with 1 increment by 1 nocache;

commit;

update command options using c on;

terminate;