-- 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 tper_mdl_modules
--
-- The sequence for the primary key for the mdl table is always an even number
-- The sequence for the primary key for the prf table is always an odd number
-- This is to facilitate the distinction between modules and module instances during GUI magic
-- ===================================================================

drop table tper_mdl_modules;
create table tper_mdl_modules
( 
    mdl_module_id                 bigint not null,
    mdl_module_name               varchar(100),
    mdl_width                     char,
    mdl_customizable              char,
    mdl_class_name                varchar(100),
    constraint mdl_0_pk
        primary key (mdl_module_id)
) 

in users index in indx;


drop synonym mdl;
create synonym mdl for tper_mdl_modules;

-- ===================================================================
--
-- Table tper_pag_pages
--

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

drop table tper_pag_pages;
create table tper_pag_pages
( 
    pag_company_id                bigint,
    pag_user_id                   bigint,
    pag_page_id                   bigint not null,
    pag_page_name                 varchar(100),
    constraint pag_0_pk
        primary key (pag_page_id)
) 

in users index in indx;


drop synonym pag;
create synonym pag for tper_pag_pages;

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

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

drop table tper_prf_preferences;
create table tper_prf_preferences
( 
    prf_company_id                bigint,
    prf_instance_id               bigint not null,
    prf_page_id                   bigint,
    prf_module_id                 bigint,
    prf_order                     bigint,
    prf_minimized                 bigint,
    constraint prf_0_pk
        primary key (prf_instance_id)
) 

in users index in indx;


drop synonym prf;
create synonym prf for tper_prf_preferences;

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

-- ===================================================================
--
-- Table tper_par_params
--

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

drop table tper_par_params;
create table tper_par_params
( 
    par_company_id                bigint,
    par_instance_id               bigint,
    par_display_name              varchar(100),
    par_param_value               varchar(1000)
) 

in users index in indx;


drop synonym par;
create synonym par for tper_par_params;

-- ===================================================================
--
-- Table tper_lft_leftnav
--
-- Data for the left nav bar
-- ===================================================================

drop table tper_lft_leftnav;
create table tper_lft_leftnav
( 
    lft_window_id                 bigint not null,
    lft_company_id                bigint not null,
    lft_user_id                   bigint not null,
    lft_module_moniker            varchar(256),
    lft_module_state              varchar(1000),
    lft_window_maximized          char,
    lft_window_prev               bigint not null,
    lft_window_next               bigint not null,
    constraint lft_0_pk
        primary key (lft_window_id),
    constraint lft_1_uk
        unique (lft_company_id, lft_user_id, lft_window_prev),
    constraint lft_2_uk
        unique (lft_company_id, lft_user_id, lft_window_next)
) 

in users index in indx;


drop synonym lft;
create synonym lft for tper_lft_leftnav;

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

-- ===================================================================
--
-- Table tper_ucs_user_console_setting
--
-- Data for the console specific user settings including default sorting column,
-- hidden columns and rows per page.
-- ===================================================================

drop table tper_ucs_user_console_setting;
create table tper_ucs_user_console_setting
( 
    ucs_company_id                bigint not null,
    ucs_user_id                   bigint not null,
    ucs_console_id                varchar(100) not null,
    ucs_page_size                 bigint,
    ucs_sort_data                 varchar(1000),
    ucs_search_data               varchar(1000),
    ucs_hide_columns              varchar(1000),
    constraint ucs_0_uk
        unique (ucs_console_id, ucs_user_id, ucs_company_id)
) 

in users index in indx;


drop synonym ucs;
create synonym ucs for tper_ucs_user_console_setting;

drop sequence qper_mdl_module_id restrict;
create sequence qper_mdl_module_id start with 1 increment by 2 nocache;
drop sequence qper_prf_instance_id restrict;
create sequence qper_prf_instance_id start with 2 increment by 2 nocache;

commit;

update command options using c on;

terminate;