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

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

drop table tpgc_pgc_page_customization;
create table tpgc_pgc_page_customization
( 
    pgc_company_id                bigint,
    pgc_page_id                   bigint,
    pgc_page_name                 varchar(100)
) 

in users index in indx;


drop synonym pgc;
create synonym pgc for tpgc_pgc_page_customization;

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

-- ===================================================================
--
-- Table tpgc_mod_module
--

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

drop table tpgc_mod_module;
create table tpgc_mod_module
( 
    mod_company_id                bigint,
    mod_module_id                 bigint,
    mod_module_name               varchar(100),
    mod_width                     char,
    mod_customizable              char,
    mod_class_name                varchar(100)
) 

in users index in indx;


drop synonym mod;
create synonym mod for tpgc_mod_module;

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

-- ===================================================================
--
-- Table tpgc_pfr_preferences
--
-- The sequence for the primary key for the mod table is always an even number
-- The sequence for the primary key for the pfr table is always an odd number
-- This is to facilitate the distinction between modules and module instances during GUI magic
-- ===================================================================

drop table tpgc_pfr_preferences;
create table tpgc_pfr_preferences
( 
    pfr_company_id                bigint,
    pfr_instance_id               bigint not null,
    pfr_page_id                   bigint,
    pfr_module_id                 bigint,
    pfr_order                     bigint,
    constraint pfr_0_pk
        primary key (pfr_instance_id)
) 

in users index in indx;


drop synonym pfr;
create synonym pfr for tpgc_pfr_preferences;

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

-- ===================================================================
--
-- Table tpgc_mxm_maxmin
--
-- This table keeps track of a user's view of a pgc, i.e. whether a module is maximized or minimized.
-- ===================================================================

drop table tpgc_mxm_maxmin;
create table tpgc_mxm_maxmin
( 
    mxm_company_id                bigint,
    mxm_user_id                   bigint,
    mxm_instance_id               bigint,
    mxm_maximized                 bigint
) 

in users index in indx;


drop synonym mxm;
create synonym mxm for tpgc_mxm_maxmin;

-- ===================================================================
--
-- Table tpgc_pmr_params
--

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

drop table tpgc_pmr_params;
create table tpgc_pmr_params
( 
    pmr_company_id                bigint,
    pmr_instance_id               bigint,
    pmr_display_name              varchar(100),
    pmr_param_value               varchar(1000)
) 

in users index in indx;


drop synonym pmr;
create synonym pmr for tpgc_pmr_params;

drop sequence qpgc_pgc_page_id restrict;
create sequence qpgc_pgc_page_id start with 1 increment by 1 nocache;
drop sequence qpgc_mod_module_id restrict;
create sequence qpgc_mod_module_id start with 1 increment by 2 nocache;
drop sequence qpgc_pfr_instance_id restrict;
create sequence qpgc_pfr_instance_id start with 2 increment by 2 nocache;

commit;

update command options using c on;

terminate;