-- 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 tque_mqu_queue
--

-- ===================================================================

drop table tque_mqu_queue;
create table tque_mqu_queue
( 
    mqu_queue_id                  bigint not null,
    mqu_cmp_id                    bigint not null,
    mqu_name                      varchar(100) not null,
    mqu_desc                      varchar(2000),
    mqu_protocol                  varchar(50),
    mqu_sync_script_path          varchar(2000),
    constraint mqu_0_pk
        primary key (mqu_queue_id),
    constraint mqu_1_uk
        unique (mqu_name, mqu_cmp_id)
) 

in users index in indx;


drop synonym mqu;
create synonym mqu for tque_mqu_queue;

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

-- ===================================================================
--
-- Table tque_msg_message
--

-- ===================================================================

drop table tque_msg_message;
create table tque_msg_message
( 
    msg_msg_id                    bigint not null,
    msg_cmp_id                    bigint,
    msg_user_id                   bigint,
    msg_queue_id                  bigint,
    msg_processable               varchar(20),
    msg_status                    varchar(40),
    msg_doc_path                  varchar(1000),
    msg_protocol_rsp_path         varchar(1000),
    msg_app_rsp_path              varchar(1000),
    msg_arrival_time              timestamp,
    msg_arrival_info              varchar(100),
    msg_send_pickup_time          timestamp,
    msg_sync_completion_time      timestamp,
    msg_sync_status_type          varchar(20),
    msg_sync_status               varchar(2000),
    constraint msg_0_pk
        primary key (msg_msg_id)
) 

in users index in indx;


drop synonym msg;
create synonym msg for tque_msg_message;

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

-- ===================================================================
--
-- Table tque_msd_message_definition
--

-- ===================================================================

drop table tque_msd_message_definition;
create table tque_msd_message_definition
( 
    msd_type_id                   bigint,
    msd_cmp_id                    bigint,
    msd_message_type              varchar(256)
) 

in users index in indx;


drop synonym msd;
create synonym msd for tque_msd_message_definition;

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

-- ===================================================================
--
-- Table tque_mtd_queue_msg_type_detail
--

-- ===================================================================

drop table tque_mtd_queue_msg_type_detail;
create table tque_mtd_queue_msg_type_detail
( 
    mtd_type_id                   bigint,
    mtd_cmp_id                    bigint,
    mtd_attr_name                 varchar(256),
    mtd_value                     varchar(3000)
) 

in users index in indx;


drop synonym mtd;
create synonym mtd for tque_mtd_queue_msg_type_detail;

-- ===================================================================
--
-- Table tque_qmm_queue_message_map
--

-- ===================================================================

drop table tque_qmm_queue_message_map;
create table tque_qmm_queue_message_map
( 
    qmm_queue_id                  bigint,
    qmm_msg_type_id               bigint
) 

in users index in indx;


drop synonym qmm;
create synonym qmm for tque_qmm_queue_message_map;

-- ===================================================================
--
-- Table tque_qtm_que_type_message_map
--

-- ===================================================================

drop table tque_qtm_que_type_message_map;
create table tque_qtm_que_type_message_map
( 
    qtm_queue_type                varchar(256),
    qtm_msg_type_id               bigint
) 

in users index in indx;


drop synonym qtm;
create synonym qtm for tque_qtm_que_type_message_map;



commit;

update command options using c on;

terminate;