-- 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 tapp_req_request
--
-- This is the 'request for approval' table.
-- requester_id and approver_id are user_ids
-- the status is defined in RequestStatusEnum as:
-- - P for pending
-- - R for rejected
-- - A for accepted
-- - C for canceled
-- - N for new
-- the type is defined in RequestTypeEnum as:
-- - AGG for aggregation
-- - SYN for syndication
-- params is a pipe/colon delimited list of name=value... use Attributes Class to flatten/unflatten
-- ===================================================================

drop table tapp_req_request;
create table tapp_req_request
( 
    req_id                        bigint,
    req_cmp_id                    bigint,
    req_requester_id              bigint,
    req_approver_id               bigint,
    req_request_date              timestamp,
    req_response_date             timestamp,
    req_request_txt               varchar(4000),
    req_response_txt              varchar(4000),
    req_status                    char,
    req_type                      varchar(100),
    req_params                    varchar(1000)
) 

in users index in indx;


drop synonym req;
create synonym req for tapp_req_request;

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



commit;

update command options using c on;

terminate;