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

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

drop table tsch_scj_job;
create table tsch_scj_job
( 
    scj_job_id                    bigint,
    scj_description               varchar(1000),
    scj_user_id                   bigint,
    scj_executable                varchar(100),
    scj_company_id                bigint,
    scj_recurring                 char
) 

in users index in indx;


drop synonym scj;
create synonym scj for tsch_scj_job;

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

-- ===================================================================
--
-- Table tsch_scp_params
--
-- special parameter:
-- RUN_ON_SVC=<svc short name>: the job can only run on a given service (scheduler)
-- ===================================================================

drop table tsch_scp_params;
create table tsch_scp_params
( 
    scp_job_id                    bigint,
    scp_company_id                bigint,
    scp_param_name                varchar(100),
    scp_param_value               varchar(1000)
) 

in users index in indx;


drop synonym scp;
create synonym scp for tsch_scp_params;

-- ===================================================================
--
-- Table tsch_ssp_schedule_params
--

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

drop table tsch_ssp_schedule_params;
create table tsch_ssp_schedule_params
( 
    ssp_schedule_id               bigint,
    ssp_company_id                bigint,
    ssp_param_name                varchar(100),
    ssp_param_value               varchar(1000)
) 

in users index in indx;


drop synonym ssp;
create synonym ssp for tsch_ssp_schedule_params;

-- ===================================================================
--
-- Table tsch_sch_schedule
--

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

drop table tsch_sch_schedule;
create table tsch_sch_schedule
( 
    sch_schedule_id               bigint not null,
    sch_next_running_time         timestamp,
    sch_description               varchar(1000),
    sch_sch_type                  char,
    sch_job_id                    bigint,
    sch_time_info                 timestamp,
    sch_company_id                bigint,
    sch_user_id                   bigint,
    sch_enabled                   char,
    constraint sch_0_pk
        primary key (sch_schedule_id)
) 

in users index in indx;


drop synonym sch;
create synonym sch for tsch_sch_schedule;

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

-- ===================================================================
--
-- Table tsch_scc_completedschedules
--

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

drop table tsch_scc_completedschedules;
create table tsch_scc_completedschedules
( 
    scc_schedule_id               bigint,
    scc_schedule_index            bigint,
    scc_return_value              varchar(4000),
    scc_status                    char,
    scc_start_time                timestamp,
    scc_completion_time           timestamp,
    scc_company_id                bigint,
    scc_user_id                   bigint
) 

in users index in indx;


drop synonym scc;
create synonym scc for tsch_scc_completedschedules;

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

-- ===================================================================
--
-- Table tsch_scs_schedulestatus
--

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

drop table tsch_scs_schedulestatus;
create table tsch_scs_schedulestatus
( 
    scs_schedule_id               bigint,
    scs_percent_done              bigint,
    scs_user_id                   bigint,
    scs_company_id                bigint,
    scs_start_time                timestamp,
    scs_update_time               timestamp
) 

in users index in indx;


drop synonym scs;
create synonym scs for tsch_scs_schedulestatus;

-- ===================================================================
--
-- Table tsch_srv_server
--

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

drop table tsch_srv_server;
create table tsch_srv_server
( 
    srv_port                      bigint,
    srv_server                    varchar(100)
) 

in users index in indx;


drop synonym srv;
create synonym srv for tsch_srv_server;



commit;

update command options using c on;

terminate;