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





-- ===================================================================
--
-- 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 530_to_532.tapp_req_request;
create table 530_to_532.tapp_req_request
( 
    req_id                        integer,
    req_cmp_id                    integer,
    req_requester_id              integer,
    req_approver_id               integer,
    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 530_to_532.req;
create synonym 530_to_532.req for 530_to_532.tapp_req_request;


-- ===================================================================
--
-- Table taud_alo_audit_log
--
-- Contains the Audit Logs for specific events
-- ===================================================================

drop table 530_to_532.taud_alo_audit_log;
create table 530_to_532.taud_alo_audit_log
( 
    alo_id                        integer,
    alo_company_id                integer,
    alo_event_name                varchar(100),
    alo_timestamp                 timestamp,
    alo_user_id                   integer,
    alo_description               varchar(4000)
) 

in users index in indx;



drop synonym 530_to_532.alo;
create synonym 530_to_532.alo for 530_to_532.taud_alo_audit_log;


-- ===================================================================
--
-- Table tbil_bil_billing_info
--

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

drop table 530_to_532.tbil_bil_billing_info;
create table 530_to_532.tbil_bil_billing_info
( 
    bil_cmp_id                    integer,
    bil_usage                     varchar(256),
    bil_rate                      decimal(9,2)
) 

in users index in indx;



drop synonym 530_to_532.bil;
create synonym 530_to_532.bil for 530_to_532.tbil_bil_billing_info;







-- ===================================================================
--
-- Table tcnt_sen_selected_entry
--
-- Contains the mapping of items  and selection_id.
-- ===================================================================

drop table 530_to_532.tcnt_sen_selected_entry;
create table 530_to_532.tcnt_sen_selected_entry
( 
    sen_company_id                integer,
    sen_selection_id              integer,
    sen_src_container_id          integer,
    sen_selected_container_id     integer,
    sen_entry_id                  integer,
    sen_get_children              varchar(80)
) 

in users index in indx;



drop synonym 530_to_532.sen;
create synonym 530_to_532.sen for 530_to_532.tcnt_sen_selected_entry;

-- ===================================================================
--
-- Table tcnt_cnt_container
--
-- A container has attributes as described in the tcnt_cna_container_attributes table (cna).
-- A company has many cotainer.
-- A container name is unique to a company for a given type.  This is enforced.
-- A container id is unique.  This is enforced.
-- ===================================================================

drop table 530_to_532.tcnt_cnt_container;
create table 530_to_532.tcnt_cnt_container
( 
    cnt_company_id                integer,
    cnt_id                        integer,
    cnt_name                      varchar(100),
    cnt_type                      varchar(100),
    cnt_object_group_id           integer,
    cnt_container_type            varchar(128)
) 

in users index in indx;



drop synonym 530_to_532.cnt;
create synonym 530_to_532.cnt for 530_to_532.tcnt_cnt_container;

-- ===================================================================
--
-- Table tcnt_cna_container_attributes
--
-- Extra attributes for a container are kept in name value pairs.
-- A name may exist multiple times for a particular catalog.
-- ===================================================================

drop table 530_to_532.tcnt_cna_container_attributes;
create table 530_to_532.tcnt_cna_container_attributes
( 
    cna_company_id                integer,
    cna_container_id              integer,
    cna_name                      varchar(100),
    cna_value                     varchar(800),
    cna_version_id                integer,
    cna_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.cna;
create synonym 530_to_532.cna for 530_to_532.tcnt_cna_container_attributes;

-- ===================================================================
--
-- Table tcnt_ent_entry
--
-- This is the entry table. We keep all attributes for an entry whether inherited from the
-- container specification or from the set of categories the entry belongs to in the entry
-- attributes table. So we can have 2 entries that belong to the same catalog but have a
-- different number of attributes.
-- ===================================================================

drop table 530_to_532.tcnt_ent_entry;
create table 530_to_532.tcnt_ent_entry
( 
    ent_company_id                integer,
    ent_id                        integer,
    ent_container_id              integer not null,
    ent_primary_key               varchar(300) not null,
    ent_version_id                integer,
    ent_next_version_id           integer not null,
    ent_status                    varchar(300),
    ent_collab_info               varchar(3000),
    ent_entry_type                varchar(128),
    constraint ent_1_uk
        unique (ent_container_id, ent_primary_key, ent_next_version_id)
) 

in users index in indx;



drop synonym 530_to_532.ent;
create synonym 530_to_532.ent for 530_to_532.tcnt_ent_entry;

-- ===================================================================
--
-- Table tcnt_eta_entry_attributes
--
-- Table holding name value pairs for entry attributes.  The type column tells you whether the
-- value for 530_to_532.this attribute is of basic type numeric, string, or date.  The node id is the name
-- part of our name-value pair.  It is the id of the node of type attribute in a spec.  Please
-- read Versioning Howto.
-- NOTE: ADDING THE DBNAME ATTRIBUTE TO THE VALUE_NUMERIC COLUMN THE LENGTH FOR ORACLE WOULD BE
-- 38,12, AND FOR DB2 IT WILL BE 31, 12 ... DB LIMIT !!
-- NOTE: IF YOU CHANGE THIS CHANGE TCTG_CAB_CATEGORY_ATTRIBUTES TOO (SAME SETUP AS THIS)
-- ===================================================================

drop table 530_to_532.tcnt_eta_entry_attributes;
create table 530_to_532.tcnt_eta_entry_attributes
( 
    eta_company_id                integer,
    eta_container_id              integer,
    eta_entry_id                  integer,
    eta_node_id                   integer,
    eta_value_numeric             decimal(31, 12),
    eta_value_string              varchar(900),
    eta_version_id                integer,
    eta_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.eta;
create synonym 530_to_532.eta for 530_to_532.tcnt_eta_entry_attributes;

-- ===================================================================
--
-- Table tcnt_esa_entry_sys_attr
--
-- Table holding the system (internal use only) attributes of a category -- name and value.
-- NOTE: CHANGED VALUE COLUMN LENGTH TO 850 TO REDUCE THE SIZE OF THE INDEX - DB2
-- ===================================================================

drop table 530_to_532.tcnt_esa_entry_sys_attr;
create table 530_to_532.tcnt_esa_entry_sys_attr
( 
    esa_company_id                integer,
    esa_container_id              integer,
    esa_entry_id                  integer,
    esa_name                      varchar(100),
    esa_value                     varchar(850),
    esa_version_id                integer,
    esa_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.esa;
create synonym 530_to_532.esa for 530_to_532.tcnt_esa_entry_sys_attr;

-- ===================================================================
--
-- Table tcnt_esm_entry_spec_map
--
-- Table holding mapping between categories and specs
-- ===================================================================

drop table 530_to_532.tcnt_esm_entry_spec_map;
create table 530_to_532.tcnt_esm_entry_spec_map
( 
    esm_company_id                integer,
    esm_container_id              integer,
    esm_entry_id                  integer,
    esm_spec_id                   integer,
    esm_filter_container_id       integer,
    esm_version_id                integer,
    esm_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.esm;
create synonym 530_to_532.esm for 530_to_532.tcnt_esm_entry_spec_map;

-- ===================================================================
--
-- Table tcnt_efp_entry_full_paths
--
-- Table holding the full paths of an entry
-- Patrice & Saad: This should never be queried by anyone other than the search dynamic queries
-- ===================================================================

drop table 530_to_532.tcnt_efp_entry_full_paths;
create table 530_to_532.tcnt_efp_entry_full_paths
( 
    efp_company_id                integer,
    efp_container_id              integer not null,
    efp_entry_id                  integer,
    efp_full_path_type            varchar(100) not null,
    efp_full_path                 varchar(850) not null,
    efp_version_id                integer,
    efp_next_version_id           integer not null,
    constraint efp_0_uk
        unique (efp_container_id, efp_full_path_type, efp_full_path, efp_next_version_id)
) 

in users index in indx;



drop synonym 530_to_532.efp;
create synonym 530_to_532.efp for 530_to_532.tcnt_efp_entry_full_paths;

-- ===================================================================
--
-- Table tcnt_ehi_entry_hierarchy
--

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

drop table 530_to_532.tcnt_ehi_entry_hierarchy;
create table 530_to_532.tcnt_ehi_entry_hierarchy
( 
    ehi_company_id                integer,
    ehi_container_id              integer,
    ehi_container_type            varchar(100),
    ehi_parent_id                 integer,
    ehi_child_id                  integer,
    ehi_version_id                integer,
    ehi_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.ehi;
create synonym 530_to_532.ehi for 530_to_532.tcnt_ehi_entry_hierarchy;

-- ===================================================================
--
-- Table tcnt_eem_entry_entry_map
--
-- Mapping between a source and a destination entry..
-- ===================================================================

drop table 530_to_532.tcnt_eem_entry_entry_map;
create table 530_to_532.tcnt_eem_entry_entry_map
( 
    eem_company_id                integer,
    eem_src_entry_id              integer,
    eem_src_container_id          integer,
    eem_dst_entry_id              integer,
    eem_dst_container_id          integer,
    eem_version_id                integer,
    eem_next_version_id           integer,
    eem_map_type                  varchar(300)
) 

in users index in indx;



drop synonym 530_to_532.eem;
create synonym 530_to_532.eem for 530_to_532.tcnt_eem_entry_entry_map;


-- ===================================================================
--
-- Table tctg_sel_selection
--
-- Contains generic selection information.
-- ===================================================================

drop table 530_to_532.tctg_sel_selection;
create table 530_to_532.tctg_sel_selection
( 
    sel_company_id                integer,
    sel_catalog_id                integer,
    sel_version_id                integer,
    sel_selection_name            varchar(100),
    sel_selection_id              integer,
    sel_selection_type            char,
    sel_cat_tree_id               integer,
    sel_hidden_flag               char,
    sel_object_group_id           integer
) 

in users index in indx;



drop synonym 530_to_532.sel;
create synonym 530_to_532.sel for 530_to_532.tctg_sel_selection;

-- ===================================================================
--
-- Table tctg_dys_dynamic_selection
--
-- Contains dynamic selection query strings.
-- ===================================================================

drop table 530_to_532.tctg_dys_dynamic_selection;
create table 530_to_532.tctg_dys_dynamic_selection
( 
    dys_company_id                integer,
    dys_selection_id              integer,
    dys_query_string              varchar(900),
    dys_row_order                 integer
) 

in users index in indx;



drop synonym 530_to_532.dys;
create synonym 530_to_532.dys for 530_to_532.tctg_dys_dynamic_selection;

-- ===================================================================
--
-- Table tctg_sit_selected_item
--
-- Contains the mapping of items  and selection_id.
-- ===================================================================

drop table 530_to_532.tctg_sit_selected_item;
create table 530_to_532.tctg_sit_selected_item
( 
    sit_company_id                integer,
    sit_selection_id              integer,
    sit_cat_tree_id               integer,
    sit_catalog_id                integer,
    sit_item_id                   integer
) 

in users index in indx;



drop synonym 530_to_532.sit;
create synonym 530_to_532.sit for 530_to_532.tctg_sit_selected_item;

-- ===================================================================
--
-- Table tctg_sca_selected_category
--
-- Contains the cateogory ids of selected categories
-- ===================================================================

drop table 530_to_532.tctg_sca_selected_category;
create table 530_to_532.tctg_sca_selected_category
( 
    sca_company_id                integer,
    sca_selection_id              integer,
    sca_catalog_id                integer,
    sca_cat_tree_id               integer,
    sca_category_id               integer
) 

in users index in indx;



drop synonym 530_to_532.sca;
create synonym 530_to_532.sca for 530_to_532.tctg_sca_selected_category;

-- ===================================================================
--
-- Table tctg_dso_data_source
--
-- Table holding the name, type of transfer, and company id for data sources.
-- ===================================================================

drop table 530_to_532.tctg_dso_data_source;
create table 530_to_532.tctg_dso_data_source
( 
    dso_id                        integer,
    dso_name                      varchar(200),
    dso_company_id                integer,
    dso_protocol_id               varchar(30)
) 

in users index in indx;



drop synonym 530_to_532.dso;
create synonym 530_to_532.dso for 530_to_532.tctg_dso_data_source;

-- ===================================================================
--
-- Table tctg_dsd_data_source_details
--
-- Table holding the name / value pairs for 530_to_532.the required parameters of a given data
-- source.
-- ===================================================================

drop table 530_to_532.tctg_dsd_data_source_details;
create table 530_to_532.tctg_dsd_data_source_details
( 
    dsd_datasource_id             integer,
    dsd_company_id                integer,
    dsd_name                      varchar(50),
    dsd_value                     varchar(2000)
) 

in users index in indx;



drop synonym 530_to_532.dsd;
create synonym 530_to_532.dsd for 530_to_532.tctg_dsd_data_source_details;

-- ===================================================================
--
-- Table tctg_fee_feed
--
-- Table pulling together components of a data feed to Trigo
-- ===================================================================

drop table 530_to_532.tctg_fee_feed;
create table 530_to_532.tctg_fee_feed
( 
    fee_company_id                integer not null,
    fee_feed_id                   integer,
    fee_name                      varchar(100) not null,
    fee_feed_type                 varchar(30),
    fee_feed_semantics            varchar(30),
    fee_data_source_id            integer,
    fee_file_spec_id              integer,
    fee_script_path               varchar(256),
    fee_ctg_id                    integer,
    fee_spec_map_id               integer,
    fee_ctr_id                    integer,
    fee_doc_store_path            varchar(200),
    fee_fetch_job_id              integer,
    fee_load_job_id               integer,
    fee_request_id                integer,
    fee_charset_name              varchar(200),
    fee_extra_attribs             varchar(4000),
    fee_object_group_id           integer,
    constraint fee_0_pk
        primary key (fee_name, fee_company_id)
) 

in users index in indx;



drop synonym 530_to_532.fee;
create synonym 530_to_532.fee for 530_to_532.tctg_fee_feed;

-- ===================================================================
--
-- Table tctg_ftf_fetched_files
--
-- Table that lists the files that have been fetched
-- ===================================================================

drop table 530_to_532.tctg_ftf_fetched_files;
create table 530_to_532.tctg_ftf_fetched_files
( 
    ftf_company_id                integer,
    ftf_feed_id                   integer,
    ftf_filename                  varchar(1000),
    ftf_doc_store_path            varchar(1000),
    ftf_date_fetched              timestamp
) 

in users index in indx;



drop synonym 530_to_532.ftf;
create synonym 530_to_532.ftf for 530_to_532.tctg_ftf_fetched_files;

-- ===================================================================
--
-- Table tctg_syn_syndication
--
-- Table pulling together components of catalog data outflow from Trigo
-- ===================================================================

drop table 530_to_532.tctg_syn_syndication;
create table 530_to_532.tctg_syn_syndication
( 
    syn_company_id                integer,
    syn_syndication_id            integer,
    syn_type                      varchar(100),
    syn_mktplace_spec_id          integer,
    syn_script_path               varchar(256),
    syn_file_type                 varchar(100),
    syn_catalog_id                integer,
    syn_spec_map_id               integer,
    syn_version_id                integer,
    syn_cat_tree_id               integer,
    syn_version_id_2              integer,
    syn_diff_types                varchar(100),
    syn_selection_id              integer,
    syn_job_id                    integer,
    syn_distributions             varchar(3000),
    syn_distribution_groups       varchar(3000),
    syn_request_id                integer,
    syn_charset_name              varchar(200),
    syn_params_doc_path           varchar(3000),
    syn_name                      varchar(100)
) 

in users index in indx;



drop synonym 530_to_532.syn;
create synonym 530_to_532.syn for 530_to_532.tctg_syn_syndication;

-- ===================================================================
--
-- Table tctg_cce_ctlg_ctlg_export
--
-- Table to support holding catalog to catalog export information
-- ===================================================================

drop table 530_to_532.tctg_cce_ctlg_ctlg_export;
create table 530_to_532.tctg_cce_ctlg_ctlg_export
( 
    cce_company_id                integer,
    cce_id                        integer,
    cce_name                      varchar(100),
    cce_type                      varchar(100),
    cce_src_catalog_id            integer,
    cce_src_selection_id          integer,
    cce_src_version_id            integer,
    cce_src_version_id2           integer,
    cce_dest_catalog_id           integer,
    cce_spec_map_id               integer,
    cce_diff_types                varchar(100),
    cce_job_id                    integer,
    cce_request_id                integer,
    cce_script_path               varchar(256),
    cce_params_doc_path           varchar(3000)
) 

in users index in indx;



drop synonym 530_to_532.cce;
create synonym 530_to_532.cce for 530_to_532.tctg_cce_ctlg_ctlg_export;

-- ===================================================================
--
-- Table tctg_fi2_file
--
-- Contains basic information related to files (uploaded by suppliers or generated
-- by the system)
-- ===================================================================

drop table 530_to_532.tctg_fi2_file;
create table 530_to_532.tctg_fi2_file
( 
    fi2_file_id                   integer,
    fi2_company_id                integer,
    fi2_date_created              timestamp,
    fi2_type                      char
) 

in users index in indx;



drop synonym 530_to_532.fi2;
create synonym 530_to_532.fi2 for 530_to_532.tctg_fi2_file;

-- ===================================================================
--
-- Table tctg_fia_file_attribute
--
-- Contains more attributes as name/value pairs for files (uploaded by suppliers or
-- generated by the system)
-- ===================================================================

drop table 530_to_532.tctg_fia_file_attribute;
create table 530_to_532.tctg_fia_file_attribute
( 
    fia_file_id                   integer,
    fia_company_id                integer,
    fia_attribute_name            varchar(4000),
    fia_attribute_value           varchar(4000)
) 

in users index in indx;



drop synonym 530_to_532.fia;
create synonym 530_to_532.fia for 530_to_532.tctg_fia_file_attribute;

-- ===================================================================
--
-- Table tctg_ctg_catalog
--
-- A catalog has attributes as described in the tctg_caa_catalog_attributes table (caa).
-- A company has many catalogs.
-- A catalog name is unique to a company.  This is enforced.
-- A catalog id is unique.  This is enforced.
-- ===================================================================

drop table 530_to_532.tctg_ctg_catalog;
create table 530_to_532.tctg_ctg_catalog
( 
    ctg_company_id                integer not null,
    ctg_id                        integer not null,
    ctg_name                      varchar(100) not null,
    ctg_type                      varchar(100),
    ctg_object_group_id           integer,
    constraint ctg_0_pk
        primary key (ctg_id),
    constraint ctg_1_uk
        unique (ctg_company_id, ctg_name)
) 

in users index in indx;



drop synonym 530_to_532.ctg;
create synonym 530_to_532.ctg for 530_to_532.tctg_ctg_catalog;

-- ===================================================================
--
-- Table tctg_caa_catalog_attributes
--
-- Extra attributes for a catalog are kept in name value pairs.
-- A name may exist multiple times for a particular catalog.
-- ===================================================================

drop table 530_to_532.tctg_caa_catalog_attributes;
create table 530_to_532.tctg_caa_catalog_attributes
( 
    caa_company_id                integer,
    caa_catalog_id                integer,
    caa_name                      varchar(100),
    caa_value                     varchar(800),
    caa_version_id                integer,
    caa_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.caa;
create synonym 530_to_532.caa for 530_to_532.tctg_caa_catalog_attributes;

-- ===================================================================
--
-- Table tctg_ver_version
--
-- This table contains the version control information for catalogs/category trees/specs.
-- The version numbers span companies.
-- Just because a catalog/spec/category tree is tagged with a version does not necessarily mean any entries exist with this version id.
-- A newer version has a higher version number.
-- The sequence is incremented once here.  Look in the extra section for 530_to_532.this module (last line of file).
-- ===================================================================

drop table 530_to_532.tctg_ver_version;
create table 530_to_532.tctg_ver_version
( 
    ver_company_id                integer,
    ver_object_id                 integer,
    ver_object_type               varchar(100),
    ver_id                        integer,
    ver_name                      varchar(200),
    ver_type                      varchar(100),
    ver_date                      timestamp
) 

in users index in indx;



drop synonym 530_to_532.ver;
create synonym 530_to_532.ver for 530_to_532.tctg_ver_version;

-- ===================================================================
--
-- Table tctg_itm_item
--
-- This is the item table. We keep all attributes for an item whether inherited from the
-- catalog specification or from the set of categories the item belongs to in the item
-- attributes table. So we can have 2 items that belong to the same catalog but have
-- a different number of attributes.
-- ===================================================================

drop table 530_to_532.tctg_itm_item;
create table 530_to_532.tctg_itm_item
( 
    itm_company_id                integer,
    itm_id                        integer,
    itm_container_id              integer not null,
    itm_primary_key               varchar(300) not null,
    itm_version_id                integer,
    itm_next_version_id           integer not null,
    itm_status                    varchar(300),
    itm_collab_info               varchar(3000),
    itm_last_modified             bigint,
    constraint itm_1_uk
        unique (itm_container_id, itm_primary_key, itm_next_version_id)
) 

in users index in indx;



drop synonym 530_to_532.itm;
create synonym 530_to_532.itm for 530_to_532.tctg_itm_item;

-- ===================================================================
--
-- Table tctg_itd_item_detail
--
-- This is the item detail table. It is versioned and contains possibly multiple rows of data
-- for a string representation of an item.
-- ===================================================================

drop table 530_to_532.tctg_itd_item_detail;
create table 530_to_532.tctg_itd_item_detail
( 
    itd_company_id                integer,
    itd_item_id                   integer,
    itd_container_id              integer,
    itd_blob                      blob (1G),
    itd_version_id                integer,
    itd_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.itd;
create synonym 530_to_532.itd for 530_to_532.tctg_itd_item_detail;

-- ===================================================================
--
-- Table tctg_ita_item_attributes
--
-- Table holding name value pairs for item attributes.  The type column tells you whether the
-- value for 530_to_532.this attribute is of basic type numeric, string, or date.  The node id is the name
-- part of our name-value pair.  It is the id of the node of type attribute in a spec.  Please
-- read Versioning Howto.
-- NOTE: ADDING THE DBNAME ATTRIBUTE TO THE VALUE_NUMERIC COLUMN THE LENGTH FOR ORACLE WOULD BE
-- 38,12, AND FOR DB2 IT WILL BE 31, 12 ... DB LIMIT !!
-- NOTE: IF YOU CHANGE THIS CHANGE TCTG_CAB_CATEGORY_ATTRIBUTES TOO (SAME SETUP AS THIS)
-- ===================================================================

drop table 530_to_532.tctg_ita_item_attributes;
create table 530_to_532.tctg_ita_item_attributes
( 
    ita_company_id                integer,
    ita_catalog_id                integer,
    ita_item_id                   integer,
    ita_node_id                   integer,
    ita_value_numeric             decimal(31, 12),
    ita_value_string              varchar(900),
    ita_version_id                integer,
    ita_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.ita;
create synonym 530_to_532.ita for 530_to_532.tctg_ita_item_attributes;

-- ===================================================================
--
-- Table tctg_ctr_category_tree
--
-- Table holding the name and description of category trees.  A category tree name must be
-- unique for a company.  For non-company related trees, names must also be unique
-- (i.e. UNSPSC) company_id for 530_to_532.trees that are not tied to a particular company should be given
-- a unique company_id.
-- ===================================================================

drop table 530_to_532.tctg_ctr_category_tree;
create table 530_to_532.tctg_ctr_category_tree
( 
    ctr_company_id                integer,
    ctr_id                        integer,
    ctr_name                      varchar(100),
    ctr_type                      varchar(100),
    ctr_object_group_id           integer
) 

in users index in indx;



drop synonym 530_to_532.ctr;
create synonym 530_to_532.ctr for 530_to_532.tctg_ctr_category_tree;

-- ===================================================================
--
-- Table tctg_cta_categ_tree_attribute
--
-- Table holding the attribute name and value of category trees.
-- ===================================================================

drop table 530_to_532.tctg_cta_categ_tree_attribute;
create table 530_to_532.tctg_cta_categ_tree_attribute
( 
    cta_company_id                integer,
    cta_cat_tree_id               integer,
    cta_name                      varchar(100),
    cta_value                     varchar(880),
    cta_version_id                integer,
    cta_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.cta;
create synonym 530_to_532.cta for 530_to_532.tctg_cta_categ_tree_attribute;

-- ===================================================================
--
-- Table tctg_cat_category
--
-- A category has attributes as described in the tctg_cga_cat_attribute.
-- IF YOU MAKE CHANGES on 530_to_532.tHIS TABLE PLEASE RUN AN EXPLAIN PLAN FOR QUERIES in Category.java and CategoryTree.java
-- TO MAKE SURE THEY ARE STILL FAST.
-- ===================================================================

drop table 530_to_532.tctg_cat_category;
create table 530_to_532.tctg_cat_category
( 
    cat_company_id                integer,
    cat_id                        integer,
    cat_container_id              integer not null,
    cat_primary_key               varchar(300) not null,
    cat_version_id                integer,
    cat_next_version_id           integer not null,
    cat_status                    varchar(300),
    cat_collab_info               varchar(3000),
    cat_last_modified             bigint,
    constraint cat_1_uk
        unique (cat_container_id, cat_primary_key, cat_next_version_id)
) 

in users index in indx;



drop synonym 530_to_532.cat;
create synonym 530_to_532.cat for 530_to_532.tctg_cat_category;

-- ===================================================================
--
-- Table tctg_cad_category_detail
--
-- This is the category detail table. It is versioned and contains possibly multiple rows of
-- data for a string representation of a category.
-- ===================================================================

drop table 530_to_532.tctg_cad_category_detail;
create table 530_to_532.tctg_cad_category_detail
( 
    cad_company_id                integer,
    cad_category_id               integer,
    cad_container_id              integer,
    cad_blob                      blob (1G),
    cad_version_id                integer,
    cad_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.cad;
create synonym 530_to_532.cad for 530_to_532.tctg_cad_category_detail;

-- ===================================================================
--
-- Table tctg_msq_multi_sequence
--
-- This table is used to get unique identifiers for
-- mulioccurrences in the serialized form found in cad
-- ===================================================================

drop table 530_to_532.tctg_msq_multi_sequence;
create table 530_to_532.tctg_msq_multi_sequence
( 
    msq_sequence                  integer
) 

in users index in indx;



drop synonym 530_to_532.msq;
create synonym 530_to_532.msq for 530_to_532.tctg_msq_multi_sequence;

-- ===================================================================
--
-- Table tctg_cab_category_attributes
--
-- Table holding name value pairs for category attributes.  The type column tells you whether
-- the value for 530_to_532.this attribute is of basic type numeric, string, or date.  The node id is the
-- name part of our name-value pair.  It is the id of the node of type attribute in a spec.
-- Please read Versioning Howto.
-- NOTE: ADDING THE DBNAME ATTRIBUTE TO THE VALUE_NUMERIC COLUMN THE LENGTH FOR ORACLE WOULD BE
-- 38,12, AND FOR DB2 IT WILL BE 31, 12 ... DB LIMIT !!
-- NOTE: IF YOU CHANGE THIS CHANGE TCTG_ITA_ITEM_ATTRIBUTES TOO (SAME SETUP AS THIS)
-- ===================================================================

drop table 530_to_532.tctg_cab_category_attributes;
create table 530_to_532.tctg_cab_category_attributes
( 
    cab_company_id                integer,
    cab_cat_tree_id               integer,
    cab_category_id               integer,
    cab_node_id                   integer,
    cab_value_numeric             decimal(31, 12),
    cab_value_string              varchar(900),
    cab_version_id                integer,
    cab_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.cab;
create synonym 530_to_532.cab for 530_to_532.tctg_cab_category_attributes;

-- ===================================================================
--
-- Table tctg_csm_category_spec_map
--
-- Table holding mapping between categories and specs
-- ===================================================================

drop table 530_to_532.tctg_csm_category_spec_map;
create table 530_to_532.tctg_csm_category_spec_map
( 
    csm_company_id                integer,
    csm_cat_tree_id               integer,
    csm_category_id               integer,
    csm_spec_id                   integer,
    csm_filter_catalog_id         integer,
    csm_version_id                integer,
    csm_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.csm;
create synonym 530_to_532.csm for 530_to_532.tctg_csm_category_spec_map;

-- ===================================================================
--
-- Table tctg_csa_cat_sys_attr
--
-- Table holding the system (internal use only) attributes of a category -- name and value.
-- ===================================================================

drop table 530_to_532.tctg_csa_cat_sys_attr;
create table 530_to_532.tctg_csa_cat_sys_attr
( 
    csa_company_id                integer,
    csa_cat_tree_id               integer,
    csa_category_id               integer,
    csa_name                      varchar(100),
    csa_value                     varchar(850),
    csa_version_id                integer,
    csa_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.csa;
create synonym 530_to_532.csa for 530_to_532.tctg_csa_cat_sys_attr;

-- ===================================================================
--
-- Table tctg_cfp_cat_full_paths
--
-- Table holding the full paths of a category.
-- Patrice & Saad: This should never be queried by anyone other than the search dynamic queries
-- ===================================================================

drop table 530_to_532.tctg_cfp_cat_full_paths;
create table 530_to_532.tctg_cfp_cat_full_paths
( 
    cfp_company_id                integer,
    cfp_cat_tree_id               integer not null,
    cfp_category_id               integer,
    cfp_full_path_type            varchar(100) not null,
    cfp_full_path                 varchar(850) not null,
    cfp_version_id                integer,
    cfp_next_version_id           integer not null,
    constraint cfp_0_uk
        unique (cfp_cat_tree_id, cfp_full_path_type, cfp_full_path, cfp_next_version_id)
) 

in users index in indx;



drop synonym 530_to_532.cfp;
create synonym 530_to_532.cfp for 530_to_532.tctg_cfp_cat_full_paths;

-- ===================================================================
--
-- Table tctg_chi_category_hierarchy
--
-- Mapping between a parent and child category
-- IF YOU MAKE CHANGES on 530_to_532.tHIS TABLE PLEASE RUN AN EXPLAIN PLAN FOR QUERIES in Category.java and CategoryTree.java
-- TO MAKE SURE THEY ARE STILL FAST.
-- ===================================================================

drop table 530_to_532.tctg_chi_category_hierarchy;
create table 530_to_532.tctg_chi_category_hierarchy
( 
    chi_company_id                integer,
    chi_cat_tree_id               integer,
    chi_parent_id                 integer,
    chi_child_id                  integer,
    chi_version_id                integer,
    chi_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.chi;
create synonym 530_to_532.chi for 530_to_532.tctg_chi_category_hierarchy;

-- ===================================================================
--
-- Table tctg_ccm_category_category_map
--
-- Mapping between a source and a destination category..
-- IF YOU MAKE CHANGES on 530_to_532.tHIS TABLE PLEASE RUN AN EXPLAIN PLAN FOR QUERIES in Category.java and CategoryTree.java
-- TO MAKE SURE THEY ARE STILL FAST.
-- ===================================================================

drop table 530_to_532.tctg_ccm_category_category_map;
create table 530_to_532.tctg_ccm_category_category_map
( 
    ccm_company_id                integer,
    ccm_src_cat_tree_id           integer,
    ccm_src_category_id           integer,
    ccm_dst_cat_tree_id           integer,
    ccm_dst_category_id           integer,
    ccm_version_id                integer,
    ccm_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.ccm;
create synonym 530_to_532.ccm for 530_to_532.tctg_ccm_category_category_map;

-- ===================================================================
--
-- Table tctg_icm_item_category_map
--
-- Creates the mapping between categories and their associated items. There is
-- a version_id field to make it possible to keep historical information and
-- make it possible to reassemble older versions of a catalog.
-- ***** If you change the indexes, change the where clauses of the queries and also look in com.ibm.ccd.content/xml/query/query_catalog.xml
-- and in Category.java,  CategoryTree.java, StaticSelectionBean.java
-- IF YOU MAKE CHANGES on 530_to_532.tHIS TABLE PLEASE RUN AN EXPLAIN PLAN FOR QUERIES in Category.java,  CategoryTree.java and StaticSelectionBean.java
-- TO MAKE SURE THEY ARE STILL FAST.
-- ===================================================================

drop table 530_to_532.tctg_icm_item_category_map;
create table 530_to_532.tctg_icm_item_category_map
( 
    icm_company_id                integer,
    icm_catalog_id                integer,
    icm_item_id                   integer,
    icm_cat_tree_id               integer,
    icm_category_id               integer,
    icm_version_id                integer,
    icm_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.icm;
create synonym 530_to_532.icm for 530_to_532.tctg_icm_item_category_map;

-- ===================================================================
--
-- Table tctg_spc_specification
--
-- The set of tables for specs is intended to model the XML Schema language. The idea
-- is to be able to describe all XML documents as well as most other document types
-- we will encounter. This is accomplished by having name-value pairs for 530_to_532.the specs
-- to indicate what kind of file/catalog/database we are dealing with e.g. csv,
-- pipe-delimited, tab-delimited etc. The node hierarchy defined by the set of node,
-- node_attributes and node_hierarchy tables defines the actual details of the spec.
-- Things to look out for: one attribute of the nodes is expected to be TYPE which
-- tells you whether the node is an element/attribute/type; if we are dealing with
-- sequences / all / choice we put in attributes of the same names, but make their
-- values numbers in order - each node has one attribute of this kind; if we are
-- dealing with enumerations, we put in attributes with name ENUMERATION and put
-- in all the possible values as attributes of the node.
-- Please read Versioning Howto.
-- ===================================================================

drop table 530_to_532.tctg_spc_specification;
create table 530_to_532.tctg_spc_specification
( 
    spc_company_id                integer,
    spc_id                        integer,
    spc_name                      varchar(100),
    spc_xml                       varchar(3000)
) 

in users index in indx;



drop synonym 530_to_532.spc;
create synonym 530_to_532.spc for 530_to_532.tctg_spc_specification;

-- ===================================================================
--
-- Table tctg_spa_spec_attributes
--
-- Please read spec information.
-- ===================================================================

drop table 530_to_532.tctg_spa_spec_attributes;
create table 530_to_532.tctg_spa_spec_attributes
( 
    spa_company_id                integer,
    spa_spec_id                   integer,
    spa_name                      varchar(100),
    spa_value                     varchar(887),
    spa_order                     integer,
    spa_version_id                integer,
    spa_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.spa;
create synonym 530_to_532.spa for 530_to_532.tctg_spa_spec_attributes;

-- ===================================================================
--
-- Table tctg_nod_node
--
-- Please read spec information.
-- ===================================================================

drop table 530_to_532.tctg_nod_node;
create table 530_to_532.tctg_nod_node
( 
    nod_company_id                integer,
    nod_spec_id                   integer,
    nod_id                        integer,
    nod_type                      varchar(100),
    nod_name                      varchar(800),
    nod_version_id                integer,
    nod_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.nod;
create synonym 530_to_532.nod for 530_to_532.tctg_nod_node;

-- ===================================================================
--
-- Table tctg_noa_node_attributes
--
-- Please read spec information.
-- ===================================================================

drop table 530_to_532.tctg_noa_node_attributes;
create table 530_to_532.tctg_noa_node_attributes
( 
    noa_company_id                integer,
    noa_spec_id                   integer,
    noa_node_id                   integer,
    noa_name                      varchar(100),
    noa_value                     varchar(887),
    noa_order                     integer,
    noa_version_id                integer,
    noa_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.noa;
create synonym 530_to_532.noa for 530_to_532.tctg_noa_node_attributes;

-- ===================================================================
--
-- Table tctg_noh_node_hierarchy
--
-- Please read spec information.
-- ===================================================================

drop table 530_to_532.tctg_noh_node_hierarchy;
create table 530_to_532.tctg_noh_node_hierarchy
( 
    noh_company_id                integer,
    noh_spec_id                   integer,
    noh_parent_node_id            integer,
    noh_child_node_id             integer,
    noh_order                     integer,
    noh_version_id                integer,
    noh_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.noh;
create synonym 530_to_532.noh for 530_to_532.tctg_noh_node_hierarchy;

-- ===================================================================
--
-- Table tctg_nom_node_mapping
--
-- Table to keep track of which nodes in master specs were from subspecs - required
-- now becuase the master spec doesn't point directly at the subspec and this table
-- will allow us to map between the two
-- ===================================================================

drop table 530_to_532.tctg_nom_node_mapping;
create table 530_to_532.tctg_nom_node_mapping
( 
    nom_company_id                integer,
    nom_sub_spec_id               integer,
    nom_sub_spec_node_id          integer,
    nom_master_spec_id            integer,
    nom_master_spec_node_id       integer,
    nom_version_id                integer,
    nom_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.nom;
create synonym 530_to_532.nom for 530_to_532.tctg_nom_node_mapping;

-- ===================================================================
--
-- Table tctg_obm_object_map
--
-- This table defines the name and id for a map between two objects driven by specs, such as imports and exports
-- ===================================================================

drop table 530_to_532.tctg_obm_object_map;
create table 530_to_532.tctg_obm_object_map
( 
    obm_company_id                integer,
    obm_id                        integer,
    obm_name                      varchar(256),
    obm_type                      varchar(100),
    obm_src_object_id             integer,
    obm_dst_object_id             integer,
    obm_version_id                integer,
    obm_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.obm;
create synonym 530_to_532.obm for 530_to_532.tctg_obm_object_map;

-- ===================================================================
--
-- Table tctg_omd_object_map_detail
--
-- This table holds the individual source node to
-- destination mappings
-- ===================================================================

drop table 530_to_532.tctg_omd_object_map_detail;
create table 530_to_532.tctg_omd_object_map_detail
( 
    omd_company_id                integer,
    omd_object_map_id             integer,
    omd_src_object_id             integer,
    omd_src_node_id               integer,
    omd_dst_object_id             integer,
    omd_dst_node_id               integer,
    omd_version_id                integer,
    omd_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.omd;
create synonym 530_to_532.omd for 530_to_532.tctg_omd_object_map_detail;

-- ===================================================================
--
-- Table tctg_oms_object_map_scripts
--
-- This table holds the scripts associated with
-- the map between two objects driven by specs. This table holds
-- a script path for each destination node in the object
-- map
-- ===================================================================

drop table 530_to_532.tctg_oms_object_map_scripts;
create table 530_to_532.tctg_oms_object_map_scripts
( 
    oms_company_id                integer,
    oms_object_map_id             integer,
    oms_dst_object_id             integer,
    oms_dst_node_id               integer,
    oms_script_path               varchar(4000),
    oms_version_id                integer,
    oms_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.oms;
create synonym 530_to_532.oms for 530_to_532.tctg_oms_object_map_scripts;

-- ===================================================================
--
-- Table tctg_ctm_categorization_map
--
-- Table holds the categorization maps
-- ===================================================================

drop table 530_to_532.tctg_ctm_categorization_map;
create table 530_to_532.tctg_ctm_categorization_map
( 
    ctm_company_id                integer,
    ctm_categmap_id               integer not null,
    ctm_categmap_name             varchar(300),
    ctm_filespec_id               integer,
    ctm_cattree_id                integer,
    ctm_deffile_attr              varchar(300),
    ctm_object_group_id           integer,
    constraint ctm_0_pk
        primary key (ctm_categmap_id)
) 

in users index in indx;



drop synonym 530_to_532.ctm;
create synonym 530_to_532.ctm for 530_to_532.tctg_ctm_categorization_map;

-- ===================================================================
--
-- Table tctg_cmd_categmap_detail
--
-- Table holds categorization map details
-- ===================================================================

drop table 530_to_532.tctg_cmd_categmap_detail;
create table 530_to_532.tctg_cmd_categmap_detail
( 
    cmd_company_id                integer,
    cmd_categmap_id               integer,
    cmd_detail_id                 integer not null,
    cmd_file_attr                 varchar(300),
    cmd_isRegExp                  varchar(5),
    cmd_expression                varchar(300),
    constraint cmd_0_pk
        primary key (cmd_detail_id)
) 

in users index in indx;



drop synonym 530_to_532.cmd;
create synonym 530_to_532.cmd for 530_to_532.tctg_cmd_categmap_detail;

-- ===================================================================
--
-- Table tctg_cmc_categmap_categories
--
-- Table holds the categories which specific mapping is mapped to
-- ===================================================================

drop table 530_to_532.tctg_cmc_categmap_categories;
create table 530_to_532.tctg_cmc_categmap_categories
( 
    cmc_company_id                integer,
    cmc_detail_id                 integer,
    cmc_category_id               integer
) 

in users index in indx;



drop synonym 530_to_532.cmc;
create synonym 530_to_532.cmc for 530_to_532.tctg_cmc_categmap_categories;

-- ===================================================================
--
-- Table tctg_cgm_catalog_catalog_map
--
-- Contains mappings betweens catalogs.
-- ===================================================================

drop table 530_to_532.tctg_cgm_catalog_catalog_map;
create table 530_to_532.tctg_cgm_catalog_catalog_map
( 
    cgm_company_id                integer,
    cgm_src_ctg_id                integer,
    cgm_src_node_id               integer,
    cgm_dst_ctg_id                integer,
    cgm_dst_node_id               integer,
    cgm_version_id                integer,
    cgm_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.cgm;
create synonym 530_to_532.cgm for 530_to_532.tctg_cgm_catalog_catalog_map;

-- ===================================================================
--
-- Table tctg_seq_sequence
--
-- This table contains the current value of the sequence for a
-- node id in an object - the object can be any spec driven
-- object
-- ===================================================================

drop table 530_to_532.tctg_seq_sequence;
create table 530_to_532.tctg_seq_sequence
( 
    seq_company_id                integer,
    seq_object_id                 integer not null,
    seq_object_type               varchar(100) not null,
    seq_name                      varchar(900) not null,
    seq_increment                 bigint,
    seq_value                     bigint,
    constraint seq_0_pk
        primary key (seq_object_id, seq_object_type, seq_name)
) 

in users index in indx;



drop synonym 530_to_532.seq;
create synonym 530_to_532.seq for 530_to_532.tctg_seq_sequence;

-- ===================================================================
--
-- Table tctg_epr_entry_processor_run
--
-- Keep info for latest entry processor runs.
-- ===================================================================

drop table 530_to_532.tctg_epr_entry_processor_run;
create table 530_to_532.tctg_epr_entry_processor_run
( 
    epr_run_id                    integer,
    epr_company_id                integer,
    epr_user_id                   integer,
    epr_type                      varchar(128),
    epr_entry_cnt                 integer,
    epr_start_time                timestamp,
    epr_completion_time           timestamp,
    epr_digest                    varchar(3000),
    epr_status                    char,
    epr_container_type            varchar(128),
    epr_container_id              integer
) 

in users index in indx;



drop synonym 530_to_532.epr;
create synonym 530_to_532.epr for 530_to_532.tctg_epr_entry_processor_run;

-- ===================================================================
--
-- Table tctg_rul_inheritance_rule
--
-- This table keeps the src defn of rules.  One row per node_id for a ctg or ctr.
-- ===================================================================

drop table 530_to_532.tctg_rul_inheritance_rule;
create table 530_to_532.tctg_rul_inheritance_rule
( 
    rul_company_id                integer not null,
    rul_id                        integer,
    rul_name                      varchar(900) not null,
    rul_src_ctg_id                integer,
    rul_src_ctr_id                integer,
    rul_collab_id                 integer not null,
    rul_version_id                integer,
    rul_next_version_id           integer not null,
    constraint rul_0_uk
        unique (rul_company_id, rul_name, rul_collab_id, rul_next_version_id)
) 

in users index in indx;



drop synonym 530_to_532.rul;
create synonym 530_to_532.rul for 530_to_532.tctg_rul_inheritance_rule;

-- ===================================================================
--
-- Table tctg_rgm_rul_group_map
--

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

drop table 530_to_532.tctg_rgm_rul_group_map;
create table 530_to_532.tctg_rgm_rul_group_map
( 
    rgm_company_id                integer,
    rgm_rule_id                   integer,
    rgm_attr_group_id             integer,
    rgm_version_id                integer,
    rgm_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.rgm;
create synonym 530_to_532.rgm for 530_to_532.tctg_rgm_rul_group_map;

-- ===================================================================
--
-- Table tctg_udl_user_defined_logs
--

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

drop table 530_to_532.tctg_udl_user_defined_logs;
create table 530_to_532.tctg_udl_user_defined_logs
( 
    udl_company_id                integer,
    udl_id                        integer,
    udl_name                      varchar(3000),
    udl_container_id              integer,
    udl_container_type            varchar(128),
    udl_description               varchar(3000),
    udl_running_log               char,
    udl_table_name                varchar(128)
) 

in users index in indx;



drop synonym 530_to_532.udl;
create synonym 530_to_532.udl for 530_to_532.tctg_udl_user_defined_logs;

-- ===================================================================
--
-- Table tctg_ule_user_log_entry_
--

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

drop table 530_to_532.tctg_ule_user_log_entry_;
create table 530_to_532.tctg_ule_user_log_entry_
( 
    ule_log_entry_id              integer,
    ule_date                      timestamp,
    ule_container_id              integer,
    ule_entry_id                  integer,
    ule_log                       varchar(3000),
    ule_category_id               integer,
    ule_multi_row_order           integer
) 

in users index in indx;



drop synonym 530_to_532.ule;
create synonym 530_to_532.ule for 530_to_532.tctg_ule_user_log_entry_;

-- ===================================================================
--
-- Table tctg_tmt_test_multi_row
--
-- Table for a sample of multi row stuff.
-- ===================================================================

drop table 530_to_532.tctg_tmt_test_multi_row;
create table 530_to_532.tctg_tmt_test_multi_row
( 
    tmt_company_id                integer,
    tmt_catalog_id                integer,
    tmt_item_id                   integer,
    tmt_node_id                   integer,
    tmt_type                      varchar(100),
    tmt_value_numeric             decimal(31, 8),
    tmt_value_string              varchar(3000),
    tmt_value_date                timestamp,
    tmt_version_id                integer,
    tmt_next_version_id           integer,
    tmt_order                     integer,
    tmt_parent_order              integer,
    tmt_row_order                 integer
) 

in users index in indx;



drop synonym 530_to_532.tmt;
create synonym 530_to_532.tmt for 530_to_532.tctg_tmt_test_multi_row;

-- ===================================================================
--
-- Table tctg_etp_entry_tabbed_pane
--
-- Table associating scripts and entry node ids with tabbed pane
-- ===================================================================

drop table 530_to_532.tctg_etp_entry_tabbed_pane;
create table 530_to_532.tctg_etp_entry_tabbed_pane
( 
    etp_company_id                integer,
    etp_ctg_view_id               integer,
    etp_ctg_sub_view_id           integer,
    etp_tab_id                    integer,
    etp_tab_name                  varchar(80),
    etp_tab_order                 integer,
    etp_container_type            varchar(128),
    etp_container_id              integer
) 

in users index in indx;



drop synonym 530_to_532.etp;
create synonym 530_to_532.etp for 530_to_532.tctg_etp_entry_tabbed_pane;

-- ===================================================================
--
-- Table tctg_tpa_tabbed_pane_attr
--
-- Table associating scripts and entry node ids with tabbed pane
-- ===================================================================

drop table 530_to_532.tctg_tpa_tabbed_pane_attr;
create table 530_to_532.tctg_tpa_tabbed_pane_attr
( 
    tpa_company_id                integer,
    tpa_tab_id                    integer,
    tpa_attr_group_id             integer,
    tpa_order                     integer
) 

in users index in indx;



drop synonym 530_to_532.tpa;
create synonym 530_to_532.tpa for 530_to_532.tctg_tpa_tabbed_pane_attr;

-- ===================================================================
--
-- Table tctg_ord_ordering
--
-- Table defining orderings of a catalog within a particular category trees
-- ===================================================================

drop table 530_to_532.tctg_ord_ordering;
create table 530_to_532.tctg_ord_ordering
( 
    ord_company_id                integer,
    ord_id                        integer,
    ord_name                      varchar(256),
    ord_catalog_id                integer,
    ord_cat_tree_id               integer
) 

in users index in indx;



drop synonym 530_to_532.ord;
create synonym 530_to_532.ord for 530_to_532.tctg_ord_ordering;

-- ===================================================================
--
-- Table tctg_odd_ord_detail
--
-- Table defining the detail of orderings of a catalog within a particular category trees.
-- ===================================================================

drop table 530_to_532.tctg_odd_ord_detail;
create table 530_to_532.tctg_odd_ord_detail
( 
    odd_company_id                integer,
    odd_ord_id                    integer,
    odd_catalog_id                integer,
    odd_cat_tree_id               integer,
    odd_parent_id                 integer,
    odd_child_id                  integer,
    odd_type                      varchar(100),
    odd_version_id                integer,
    odd_next_version_id           integer,
    odd_prev_id                   integer
) 

in users index in indx;



drop synonym 530_to_532.odd;
create synonym 530_to_532.odd for 530_to_532.tctg_odd_ord_detail;

-- ===================================================================
--
-- Table tctg_atg_attr_group
--

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

drop table 530_to_532.tctg_atg_attr_group;
create table 530_to_532.tctg_atg_attr_group
( 
    atg_id                        integer not null,
    atg_company_id                integer not null,
    atg_name                      varchar(140) not null,
    atg_type                      varchar(100),
    atg_description               varchar(3000),
    constraint atg_0_pk
        primary key (atg_id),
    constraint atg_1_uk
        unique (atg_company_id, atg_name)
) 

in users index in indx;



drop synonym 530_to_532.atg;
create synonym 530_to_532.atg for 530_to_532.tctg_atg_attr_group;

-- ===================================================================
--
-- Table tctg_agn_attr_group_node
--

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

drop table 530_to_532.tctg_agn_attr_group_node;
create table 530_to_532.tctg_agn_attr_group_node
( 
    agn_attr_group_id             integer not null,
    agn_company_id                integer,
    agn_spec_id                   integer not null,
    agn_node_id                   integer not null,
    agn_included                  char,
    agn_version_id                integer,
    agn_next_version_id           integer not null,
    constraint agn_0_uk
        unique (agn_attr_group_id, agn_spec_id, agn_node_id, agn_next_version_id)
) 

in users index in indx;



drop synonym 530_to_532.agn;
create synonym 530_to_532.agn for 530_to_532.tctg_agn_attr_group_node;

-- ===================================================================
--
-- Table tctg_agl_attr_group_locale
--

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

drop table 530_to_532.tctg_agl_attr_group_locale;
create table 530_to_532.tctg_agl_attr_group_locale
( 
    agl_attr_group_id             integer not null,
    agl_company_id                integer,
    agl_locale                    varchar(100) not null,
    agl_version_id                integer,
    agl_next_version_id           integer not null,
    constraint agl_0_uk
        unique (agl_attr_group_id, agl_locale, agl_next_version_id)
) 

in users index in indx;



drop synonym 530_to_532.agl;
create synonym 530_to_532.agl for 530_to_532.tctg_agl_attr_group_locale;

-- ===================================================================
--
-- Table tctg_agd_attr_group_dyn_node
--

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

drop table 530_to_532.tctg_agd_attr_group_dyn_node;
create table 530_to_532.tctg_agd_attr_group_dyn_node
( 
    agd_attr_group_id             integer not null,
    agd_company_id                integer,
    agd_spec_id                   integer not null,
    agd_node_id                   integer not null,
    agd_version_id                integer,
    agd_next_version_id           integer not null,
    constraint agd_0_uk
        unique (agd_attr_group_id, agd_spec_id, agd_node_id, agd_next_version_id)
) 

in users index in indx;



drop synonym 530_to_532.agd;
create synonym 530_to_532.agd for 530_to_532.tctg_agd_attr_group_dyn_node;

-- ===================================================================
--
-- Table tctg_sim_status_image_map
--

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

drop table 530_to_532.tctg_sim_status_image_map;
create table 530_to_532.tctg_sim_status_image_map
( 
    sim_company_id                integer,
    sim_object_container_id       integer,
    sim_object_type               varchar(50),
    sim_status                    varchar(300),
    sim_image_url                 varchar(500)
) 

in users index in indx;



drop synonym 530_to_532.sim;
create synonym 530_to_532.sim for 530_to_532.tctg_sim_status_image_map;

-- ===================================================================
--
-- Table tctg_rec_relation_container
--

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

drop table 530_to_532.tctg_rec_relation_container;
create table 530_to_532.tctg_rec_relation_container
( 
    rec_company_id                integer,
    rec_id                        integer not null,
    rec_ctg_id                    integer not null,
    rec_ctr_id                    integer not null,
    constraint rec_0_pk
        primary key (rec_id),
    constraint rec_1_uk
        unique (rec_ctg_id, rec_ctr_id)
) 

in users index in indx;



drop synonym 530_to_532.rec;
create synonym 530_to_532.rec for 530_to_532.tctg_rec_relation_container;

-- ===================================================================
--
-- Table tctg_rea_relation_attributes
--
-- Extra attributes for a catalog are kept in name value pairs.
-- A name may exist multiple times for a particular catalog.
-- ===================================================================

drop table 530_to_532.tctg_rea_relation_attributes;
create table 530_to_532.tctg_rea_relation_attributes
( 
    rea_company_id                integer,
    rea_relation_id               integer,
    rea_name                      varchar(100),
    rea_value                     varchar(800),
    rea_version_id                integer,
    rea_next_version_id           integer
) 

in users index in indx;



drop synonym 530_to_532.rea;
create synonym 530_to_532.rea for 530_to_532.tctg_rea_relation_attributes;

-- ===================================================================
--
-- Table tctg_esr_entry_search_result
--
-- Entry search result.
-- ===================================================================

drop table 530_to_532.tctg_esr_entry_search_result;
create table 530_to_532.tctg_esr_entry_search_result
( 
    esr_company_id                integer,
    esr_entry_id                  integer,
    esr_sel_id                    integer,
    esr_ctg_id                    integer,
    esr_data                      varchar(3000),
    esr_row_order                 integer
) 

in users index in indx;



drop synonym 530_to_532.esr;
create synonym 530_to_532.esr for 530_to_532.tctg_esr_entry_search_result;

-- ===================================================================
--
-- Table tdis_dsa_dst_attributes
--
-- Table holding name value pairs for item attributes.
-- ===================================================================

drop table 530_to_532.tdis_dsa_dst_attributes;
create table 530_to_532.tdis_dsa_dst_attributes
( 
    dsa_company_id                integer,
    dsa_distribution_id           integer,
    dsa_node_id                   integer,
    dsa_value                     varchar(3000)
) 

in users index in indx;



drop synonym 530_to_532.dsa;
create synonym 530_to_532.dsa for 530_to_532.tdis_dsa_dst_attributes;

-- ===================================================================
--
-- Table tdis_dst_mkt_distribution
--
-- This table contains the list of distributions that are set up.
-- One company can have multiple distributions for one marketplace
-- ===================================================================

drop table 530_to_532.tdis_dst_mkt_distribution;
create table 530_to_532.tdis_dst_mkt_distribution
( 
    dst_company_id                integer,
    dst_distribution_id           integer,
    dst_distribution_name         varchar(100),
    dst_destination               char,
    dst_type                      char,
    dst_email                     varchar(100),
    dst_hostname                  varchar(100),
    dst_userId                    varchar(100),
    dst_password                  varchar(100),
    dst_path                      varchar(500),
    dst_from                      varchar(100),
    dst_to                        varchar(100),
    dst_sub                       varchar(100),
    dst_localpath                 varchar(500)
) 

in users index in indx;



drop synonym 530_to_532.dst;
create synonym 530_to_532.dst for 530_to_532.tdis_dst_mkt_distribution;

-- ===================================================================
--
-- Table tdis_dgp_distribution_group
--

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

drop table 530_to_532.tdis_dgp_distribution_group;
create table 530_to_532.tdis_dgp_distribution_group
( 
    dgp_company_id                integer,
    dgp_distribution_group_id     integer,
    dgp_distribution_group_name   varchar(100)
) 

in users index in indx;



drop synonym 530_to_532.dgp;
create synonym 530_to_532.dgp for 530_to_532.tdis_dgp_distribution_group;

-- ===================================================================
--
-- Table tdis_dgl_distribution_list
--

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

drop table 530_to_532.tdis_dgl_distribution_list;
create table 530_to_532.tdis_dgl_distribution_list
( 
    dgl_company_id                integer,
    dgl_distribution_group_id     integer,
    dgl_distribution_id           integer
) 

in users index in indx;



drop synonym 530_to_532.dgl;
create synonym 530_to_532.dgl for 530_to_532.tdis_dgl_distribution_list;







-- ===================================================================
--
-- Table tdoc_dbl_doc_blob
--
-- Contains the content of a document
-- ===================================================================

drop table 530_to_532.tdoc_dbl_doc_blob;
create table 530_to_532.tdoc_dbl_doc_blob
( 
    dbl_cmp_id                    integer,
    dbl_doc_id                    integer,
    dbl_blob                      blob (1G)
) 

in blob_tbl_data index in indx;



drop synonym 530_to_532.dbl;
create synonym 530_to_532.dbl for 530_to_532.tdoc_dbl_doc_blob;

-- ===================================================================
--
-- Table tdoc_dhi_doc_hierarchy
--
-- Contains the path of a document
-- ===================================================================

drop table 530_to_532.tdoc_dhi_doc_hierarchy;
create table 530_to_532.tdoc_dhi_doc_hierarchy
( 
    dhi_cmp_id                    integer not null,
    dhi_doc_id                    integer,
    dhi_doc_path                  varchar(1000) not null,
    dhi_doc_real_path             varchar(1000),
    dhi_object_group_id           integer,
    dhi_system_doc                varchar(30),
    constraint dhi_0_uk
        unique (dhi_doc_path, dhi_cmp_id)
) 

in users index in indx;



drop synonym 530_to_532.dhi;
create synonym 530_to_532.dhi for 530_to_532.tdoc_dhi_doc_hierarchy;

-- ===================================================================
--
-- Table tdoc_doa_doc_attributes
--
-- Contains the attributes of a document
-- ===================================================================

drop table 530_to_532.tdoc_doa_doc_attributes;
create table 530_to_532.tdoc_doa_doc_attributes
( 
    doa_cmp_id                    integer not null,
    doa_doc_id                    integer not null,
    doa_name                      varchar(128) not null,
    doa_value                     varchar(3000),
    constraint doa_0_uk
        unique (doa_doc_id, doa_cmp_id, doa_name)
) 

in users index in indx;



drop synonym 530_to_532.doa;
create synonym 530_to_532.doa for 530_to_532.tdoc_doa_doc_attributes;

-- ===================================================================
--
-- Table tdoc_dad_docstore_audit
--
-- Contains the audit info for files in the docstore
-- ===================================================================

drop table 530_to_532.tdoc_dad_docstore_audit;
create table 530_to_532.tdoc_dad_docstore_audit
( 
    dad_cmp_id                    integer,
    dad_user_id                   integer,
    dad_doc_path                  varchar(1000),
    dad_type                      varchar(128),
    dad_date                      timestamp
) 

in users index in indx;



drop synonym 530_to_532.dad;
create synonym 530_to_532.dad for 530_to_532.tdoc_dad_docstore_audit;

-- ===================================================================
--
-- Table tdoc_sta_staging_area
--
-- Staging area info
-- ===================================================================

drop table 530_to_532.tdoc_sta_staging_area;
create table 530_to_532.tdoc_sta_staging_area
( 
    sta_cmp_id                    integer not null,
    sta_id                        integer,
    sta_name                      varchar(1000) not null,
    constraint sta_0_pk
        primary key (sta_cmp_id, sta_name)
) 

in users index in indx;



drop synonym 530_to_532.sta;
create synonym 530_to_532.sta for 530_to_532.tdoc_sta_staging_area;


-- ===================================================================
--
-- Table tevt_que_queue
--
-- Contains the flattened entries for 530_to_532.the queue.
-- ===================================================================

drop table 530_to_532.tevt_que_queue;
create table 530_to_532.tevt_que_queue
( 
    que_id                        integer,
    que_user_id                   integer,
    que_cmp_id                    integer,
    que_event_name                varchar(200),
    que_time_stamp                timestamp,
    que_message                   varchar(4000),
    que_params                    varchar(4000)
) 

in users index in indx;



drop synonym 530_to_532.que;
create synonym 530_to_532.que for 530_to_532.tevt_que_queue;

-- ===================================================================
--
-- Table tevt_qpr_queue_pointer
--
-- Contains the pointer to the queue for 530_to_532.the DeQueueing the of the queue by multiple
-- listeners.
-- ===================================================================

drop table 530_to_532.tevt_qpr_queue_pointer;
create table 530_to_532.tevt_qpr_queue_pointer
( 
    qpr_dequeue_id                integer,
    qpr_pointer                   integer
) 

in users index in indx;



drop synonym 530_to_532.qpr;
create synonym 530_to_532.qpr for 530_to_532.tevt_qpr_queue_pointer;

-- ===================================================================
--
-- Table tevt_ald_alert_description
--

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

drop table 530_to_532.tevt_ald_alert_description;
create table 530_to_532.tevt_ald_alert_description
( 
    ald_arl_desc_id               integer not null,
    ald_enabled                   char(1),
    ald_user_id                   integer,
    ald_cmp_id                    integer,
    ald_event_name                varchar(100),
    ald_condition                 varchar(1000),
    ald_alert_description         varchar(1000),
    constraint ald_0_pk
        primary key (ald_arl_desc_id)
) 

in users index in indx;



drop synonym 530_to_532.ald;
create synonym 530_to_532.ald for 530_to_532.tevt_ald_alert_description;

-- ===================================================================
--
-- Table tevt_ads_alert_subscription
--

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

drop table 530_to_532.tevt_ads_alert_subscription;
create table 530_to_532.tevt_ads_alert_subscription
( 
    ads_arl_desc_id               integer,
    ads_user_id_list              varchar(300),
    ads_cmp_id                    integer,
    ads_dist_grps                 varchar(300),
    ads_dists                     varchar(300)
) 

in users index in indx;



drop synonym 530_to_532.ads;
create synonym 530_to_532.ads for 530_to_532.tevt_ads_alert_subscription;

-- ===================================================================
--
-- Table tevt_act_actionables
--

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

drop table 530_to_532.tevt_act_actionables;
create table 530_to_532.tevt_act_actionables
( 
    act_id                        integer not null,
    act_cmp_id                    integer,
    act_type                      varchar(100),
    act_desc_sub_id               integer,
    act_recipient_type            varchar(100),
    act_user_role_id              integer,
    act_level                     varchar(100),
    act_event_group_name          varchar(25),
    act_event_name                varchar(200),
    act_param_values              varchar(200),
    act_time_stamp                timestamp,
    act_text                      varchar(4000),
    act_status                    varchar(100),
    constraint act_0_pk
        primary key (act_id)
) 

in users index in indx;



drop synonym 530_to_532.act;
create synonym 530_to_532.act for 530_to_532.tevt_act_actionables;

-- ===================================================================
--
-- Table tevt_acm_actionable_messages
--
-- Currenlty this table will only contain the messages coming from external non-trigo sources but
-- ideally the alerts that are stored in the tevt_act_actionables table should also go here.
-- This table only contains the basic information about the alerts and messages and the remaining
-- information will go to the tevt_aca_actionable_attributes table as name value pairs.
-- ===================================================================

drop table 530_to_532.tevt_acm_actionable_messages;
create table 530_to_532.tevt_acm_actionable_messages
( 
    acm_id                        integer not null,
    acm_cmp_id                    integer,
    acm_queue_id                  integer,
    acm_msg_id                    integer,
    acm_action                    varchar(100),
    acm_state                     varchar(100),
    acm_type                      varchar(100),
    acm_recipient_type            varchar(100),
    acm_status                    varchar(100),
    acm_time_stamp                timestamp,
    acm_comment                   varchar(3000),
    constraint acm_0_pk
        primary key (acm_id)
) 

in users index in indx;



drop synonym 530_to_532.acm;
create synonym 530_to_532.acm for 530_to_532.tevt_acm_actionable_messages;

-- ===================================================================
--
-- Table tevt_aca_actionable_attributes
--
-- Contains the attributes as name value pairs for 530_to_532.the tevt_acm_actionable_messages table.
-- ===================================================================

drop table 530_to_532.tevt_aca_actionable_attributes;
create table 530_to_532.tevt_aca_actionable_attributes
( 
    aca_actionable_id             integer not null,
    aca_cmp_id                    integer,
    aca_name                      varchar(100),
    aca_value                     varchar(3000),
    constraint aca_0_pk
        primary key (aca_actionable_id)
) 

in users index in indx;



drop synonym 530_to_532.aca;
create synonym 530_to_532.aca for 530_to_532.tevt_aca_actionable_attributes;

-- ===================================================================
--
-- Table tevt_ccp_calendar_cmp_pref
--

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

drop table 530_to_532.tevt_ccp_calendar_cmp_pref;
create table 530_to_532.tevt_ccp_calendar_cmp_pref
( 
    ccp_company_id                integer,
    ccp_event_name                varchar(200)
) 

in users index in indx;



drop synonym 530_to_532.ccp;
create synonym 530_to_532.ccp for 530_to_532.tevt_ccp_calendar_cmp_pref;







-- ===================================================================
--
-- Table torg_iom_item_organization_map
--
-- Creates the mapping between organizations and their associated items.
-- ===================================================================

drop table 530_to_532.torg_iom_item_organization_map;
create table 530_to_532.torg_iom_item_organization_map
( 
    iom_company_id                integer,
    iom_item_id                   integer,
    iom_catalog_id                integer,
    iom_organization_id           integer,
    iom_organization_tree_id      integer
) 

in users index in indx;



drop synonym 530_to_532.iom;
create synonym 530_to_532.iom for 530_to_532.torg_iom_item_organization_map;

-- ===================================================================
--
-- Table torg_com_category_org_map
--
-- Creates the mapping between organizations and their associated items.
-- ===================================================================

drop table 530_to_532.torg_com_category_org_map;
create table 530_to_532.torg_com_category_org_map
( 
    com_company_id                integer,
    com_category_id               integer,
    com_category_tree_id          integer,
    com_organization_id           integer,
    com_organization_tree_id      integer
) 

in users index in indx;



drop synonym 530_to_532.com;
create synonym 530_to_532.com for 530_to_532.torg_com_category_org_map;







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

drop table 530_to_532.tper_mdl_modules;
create table 530_to_532.tper_mdl_modules
( 
    mdl_module_id                 integer 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 530_to_532.mdl;
create synonym 530_to_532.mdl for 530_to_532.tper_mdl_modules;

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

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

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

in users index in indx;



drop synonym 530_to_532.pag;
create synonym 530_to_532.pag for 530_to_532.tper_pag_pages;

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

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

in users index in indx;



drop synonym 530_to_532.prf;
create synonym 530_to_532.prf for 530_to_532.tper_prf_preferences;

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

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

drop table 530_to_532.tper_par_params;
create table 530_to_532.tper_par_params
( 
    par_company_id                integer,
    par_instance_id               integer,
    par_display_name              varchar(100),
    par_param_value               varchar(1000)
) 

in users index in indx;



drop synonym 530_to_532.par;
create synonym 530_to_532.par for 530_to_532.tper_par_params;

-- ===================================================================
--
-- Table tper_lft_leftnav
--
-- Data for 530_to_532.the left nav bar
-- ===================================================================

drop table 530_to_532.tper_lft_leftnav;
create table 530_to_532.tper_lft_leftnav
( 
    lft_window_id                 integer not null,
    lft_company_id                integer not null,
    lft_user_id                   integer not null,
    lft_module_moniker            varchar(256),
    lft_module_state              varchar(1000),
    lft_window_maximized          char,
    lft_window_prev               integer not null,
    lft_window_next               integer 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 530_to_532.lft;
create synonym 530_to_532.lft for 530_to_532.tper_lft_leftnav;

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

drop table 530_to_532.tper_ucs_user_console_setting;
create table 530_to_532.tper_ucs_user_console_setting
( 
    ucs_company_id                integer not null,
    ucs_user_id                   integer not null,
    ucs_console_id                varchar(100) not null,
    ucs_page_size                 integer,
    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 530_to_532.ucs;
create synonym 530_to_532.ucs for 530_to_532.tper_ucs_user_console_setting;


-- ===================================================================
--
-- Table tpfm_pfm_performance
--

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

drop table 530_to_532.tpfm_pfm_performance;
create table 530_to_532.tpfm_pfm_performance
( 
    pfm_index                     integer,
    pfm_nref                      integer,
    pfm_max                       integer,
    pfm_min                       integer,
    pfm_count                     integer,
    pfm_total                     integer
) 

in users index in indx;



drop synonym 530_to_532.pfm;
create synonym 530_to_532.pfm for 530_to_532.tpfm_pfm_performance;

-- ===================================================================
--
-- Table tpfm_pfi_perf_index
--

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

drop table 530_to_532.tpfm_pfi_perf_index;
create table 530_to_532.tpfm_pfi_perf_index
( 
    pfi_index                     integer,
    pfi_info                      varchar(100)
) 

in users index in indx;



drop synonym 530_to_532.pfi;
create synonym 530_to_532.pfi for 530_to_532.tpfm_pfi_perf_index;

-- ===================================================================
--
-- Table tpfm_ppr_profile
--

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

drop table 530_to_532.tpfm_ppr_profile;
create table 530_to_532.tpfm_ppr_profile
( 
    ppr_company_id                integer,
    ppr_profile_id                integer,
    ppr_index                     bigint,
    ppr_start_time                bigint,
    ppr_depth                     integer,
    ppr_name                      varchar(128),
    ppr_elapsed_time              integer,
    ppr_count_iterations          integer,
    ppr_avg_per_iteration         integer,
    ppr_min_per_iteration         integer,
    ppr_max_per_iteration         integer
) 

in users index in indx;



drop synonym 530_to_532.ppr;
create synonym 530_to_532.ppr for 530_to_532.tpfm_ppr_profile;

-- ===================================================================
--
-- Table tpfm_ppi_profile_info
--

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

drop table 530_to_532.tpfm_ppi_profile_info;
create table 530_to_532.tpfm_ppi_profile_info
( 
    ppi_company_id                integer,
    ppi_user_id                   integer,
    ppi_profile_id                integer,
    ppi_profile_name              varchar(128),
    ppi_start_time                bigint
) 

in users index in indx;



drop synonym 530_to_532.ppi;
create synonym 530_to_532.ppi for 530_to_532.tpfm_ppi_profile_info;

-- ===================================================================
--
-- Table tpfm_psi_profile_schedule_info
--

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

drop table 530_to_532.tpfm_psi_profile_schedule_info;
create table 530_to_532.tpfm_psi_profile_schedule_info
( 
    psi_company_id                integer,
    psi_profile_id                integer,
    psi_schedule_index            integer,
    psi_debug_log_path            varchar(256)
) 

in users index in indx;



drop synonym 530_to_532.psi;
create synonym 530_to_532.psi for 530_to_532.tpfm_psi_profile_schedule_info;

-- ===================================================================
--
-- Table tpfm_psd_schedule_detail
--

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

drop table 530_to_532.tpfm_psd_schedule_detail;
create table 530_to_532.tpfm_psd_schedule_detail
( 
    psd_company_id                integer,
    psd_schedule_index            integer,
    psd_percent_complete          integer,
    psd_elapsed_time              integer
) 

in users index in indx;



drop synonym 530_to_532.psd;
create synonym 530_to_532.psd for 530_to_532.tpfm_psd_schedule_detail;








-- ===================================================================
--
-- Table tpgc_pgc_page_customization
--

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

drop table 530_to_532.tpgc_pgc_page_customization;
create table 530_to_532.tpgc_pgc_page_customization
( 
    pgc_company_id                integer,
    pgc_page_id                   integer,
    pgc_page_name                 varchar(100)
) 

in users index in indx;



drop synonym 530_to_532.pgc;
create synonym 530_to_532.pgc for 530_to_532.tpgc_pgc_page_customization;

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

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

drop table 530_to_532.tpgc_mod_module;
create table 530_to_532.tpgc_mod_module
( 
    mod_company_id                integer,
    mod_module_id                 integer,
    mod_module_name               varchar(100),
    mod_width                     char,
    mod_customizable              char,
    mod_class_name                varchar(100)
) 

in users index in indx;



drop synonym 530_to_532.mod;
create synonym 530_to_532.mod for 530_to_532.tpgc_mod_module;

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

drop table 530_to_532.tpgc_pfr_preferences;
create table 530_to_532.tpgc_pfr_preferences
( 
    pfr_company_id                integer,
    pfr_instance_id               integer not null,
    pfr_page_id                   integer,
    pfr_module_id                 integer,
    pfr_order                     integer,
    constraint pfr_0_pk
        primary key (pfr_instance_id)
) 

in users index in indx;



drop synonym 530_to_532.pfr;
create synonym 530_to_532.pfr for 530_to_532.tpgc_pfr_preferences;

-- ===================================================================
--
-- 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 530_to_532.tpgc_mxm_maxmin;
create table 530_to_532.tpgc_mxm_maxmin
( 
    mxm_company_id                integer,
    mxm_user_id                   integer,
    mxm_instance_id               integer,
    mxm_maximized                 integer
) 

in users index in indx;



drop synonym 530_to_532.mxm;
create synonym 530_to_532.mxm for 530_to_532.tpgc_mxm_maxmin;

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

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

drop table 530_to_532.tpgc_pmr_params;
create table 530_to_532.tpgc_pmr_params
( 
    pmr_company_id                integer,
    pmr_instance_id               integer,
    pmr_display_name              varchar(100),
    pmr_param_value               varchar(1000)
) 

in users index in indx;



drop synonym 530_to_532.pmr;
create synonym 530_to_532.pmr for 530_to_532.tpgc_pmr_params;



-- ===================================================================
--
-- Table tque_mqu_queue
--

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

drop table 530_to_532.tque_mqu_queue;
create table 530_to_532.tque_mqu_queue
( 
    mqu_queue_id                  integer not null,
    mqu_cmp_id                    integer 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 530_to_532.mqu;
create synonym 530_to_532.mqu for 530_to_532.tque_mqu_queue;

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

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

drop table 530_to_532.tque_msg_message;
create table 530_to_532.tque_msg_message
( 
    msg_msg_id                    integer not null,
    msg_cmp_id                    integer,
    msg_user_id                   integer,
    msg_queue_id                  integer,
    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 530_to_532.msg;
create synonym 530_to_532.msg for 530_to_532.tque_msg_message;

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

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

drop table 530_to_532.tque_msd_message_definition;
create table 530_to_532.tque_msd_message_definition
( 
    msd_type_id                   integer,
    msd_cmp_id                    integer,
    msd_message_type              varchar(256)
) 

in users index in indx;



drop synonym 530_to_532.msd;
create synonym 530_to_532.msd for 530_to_532.tque_msd_message_definition;

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

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

drop table 530_to_532.tque_mtd_queue_msg_type_detail;
create table 530_to_532.tque_mtd_queue_msg_type_detail
( 
    mtd_type_id                   integer,
    mtd_cmp_id                    integer,
    mtd_attr_name                 varchar(256),
    mtd_value                     varchar(3000)
) 

in users index in indx;



drop synonym 530_to_532.mtd;
create synonym 530_to_532.mtd for 530_to_532.tque_mtd_queue_msg_type_detail;

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

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

drop table 530_to_532.tque_qmm_queue_message_map;
create table 530_to_532.tque_qmm_queue_message_map
( 
    qmm_queue_id                  integer,
    qmm_msg_type_id               integer
) 

in users index in indx;



drop synonym 530_to_532.qmm;
create synonym 530_to_532.qmm for 530_to_532.tque_qmm_queue_message_map;

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

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

drop table 530_to_532.tque_qtm_que_type_message_map;
create table 530_to_532.tque_qtm_que_type_message_map
( 
    qtm_queue_type                varchar(256),
    qtm_msg_type_id               integer
) 

in users index in indx;



drop synonym 530_to_532.qtm;
create synonym 530_to_532.qtm for 530_to_532.tque_qtm_que_type_message_map;








-- ===================================================================
--
-- Table trpt_rpi_report_instance
--
-- Contains the list of reports and their attributes
-- ===================================================================

drop table 530_to_532.trpt_rpi_report_instance;
create table 530_to_532.trpt_rpi_report_instance
( 
    rpi_company_id                integer,
    rpi_report_instance_id        integer,
    rpi_type                      varchar(80),
    rpi_name                      varchar(80),
    rpi_destination_id            integer,
    rpi_job_id                    integer
) 

in users index in indx;



drop synonym 530_to_532.rpi;
create synonym 530_to_532.rpi for 530_to_532.trpt_rpi_report_instance;



-- ===================================================================
--
-- Table trss_rsa_search_attr_group
--

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

drop table 530_to_532.trss_rsa_search_attr_group;
create table 530_to_532.trss_rsa_search_attr_group
( 
    rsa_id                        integer not null,
    rsa_company_id                integer,
    rsa_user_id                   integer,
    rsa_container_id              integer,
    rsa_step_id                   integer,
    rsa_name                      varchar(140),
    constraint rsa_0_pk
        primary key (rsa_id)
) 

in users index in indx;



drop synonym 530_to_532.rsa;
create synonym 530_to_532.rsa for 530_to_532.trss_rsa_search_attr_group;







-- ===================================================================
--
-- Table tsatt_sat_sattribute
--

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

drop table 530_to_532.tsatt_sat_sattribute;
create table 530_to_532.tsatt_sat_sattribute
( 
    sat_supplier_id               integer,
    sat_name                      varchar(100),
    sat_value1                    varchar(100),
    sat_value2                    varchar(100)
) 

in users index in indx;



drop synonym 530_to_532.sat;
create synonym 530_to_532.sat for 530_to_532.tsatt_sat_sattribute;








-- ===================================================================
--
-- Table tsch_scj_job
--

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

drop table 530_to_532.tsch_scj_job;
create table 530_to_532.tsch_scj_job
( 
    scj_job_id                    integer,
    scj_description               varchar(1000),
    scj_user_id                   integer,
    scj_executable                varchar(100),
    scj_company_id                integer,
    scj_recurring                 char
) 

in users index in indx;



drop synonym 530_to_532.scj;
create synonym 530_to_532.scj for 530_to_532.tsch_scj_job;

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

drop table 530_to_532.tsch_scp_params;
create table 530_to_532.tsch_scp_params
( 
    scp_job_id                    integer,
    scp_company_id                integer,
    scp_param_name                varchar(100),
    scp_param_value               varchar(1000)
) 

in users index in indx;



drop synonym 530_to_532.scp;
create synonym 530_to_532.scp for 530_to_532.tsch_scp_params;

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

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

drop table 530_to_532.tsch_ssp_schedule_params;
create table 530_to_532.tsch_ssp_schedule_params
( 
    ssp_schedule_id               integer,
    ssp_company_id                integer,
    ssp_param_name                varchar(100),
    ssp_param_value               varchar(1000)
) 

in users index in indx;



drop synonym 530_to_532.ssp;
create synonym 530_to_532.ssp for 530_to_532.tsch_ssp_schedule_params;

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

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

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

in users index in indx;



drop synonym 530_to_532.sch;
create synonym 530_to_532.sch for 530_to_532.tsch_sch_schedule;

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

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

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

in users index in indx;



drop synonym 530_to_532.scc;
create synonym 530_to_532.scc for 530_to_532.tsch_scc_completedschedules;

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

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

drop table 530_to_532.tsch_scs_schedulestatus;
create table 530_to_532.tsch_scs_schedulestatus
( 
    scs_schedule_id               integer,
    scs_percent_done              integer,
    scs_user_id                   integer,
    scs_company_id                integer,
    scs_start_time                timestamp,
    scs_update_time               timestamp
) 

in users index in indx;



drop synonym 530_to_532.scs;
create synonym 530_to_532.scs for 530_to_532.tsch_scs_schedulestatus;

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

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

drop table 530_to_532.tsch_srv_server;
create table 530_to_532.tsch_srv_server
( 
    srv_port                      integer,
    srv_server                    varchar(100)
) 

in users index in indx;



drop synonym 530_to_532.srv;
create synonym 530_to_532.srv for 530_to_532.tsch_srv_server;







-- ===================================================================
--
-- Table tsec_scu_user
--
-- All users are kept in this table. Additional fields will be added
-- as needed. Currently only being used to support login and display
-- the users name. Also, the user's company is retrieved from this
-- table and the scu_company_id plays a critical role in all operations
-- in Trigo. The active field (Y/N) shows if the user is enabled or
-- disabled. An user can only login if the active field is 'Y'.
-- ===================================================================

drop table 530_to_532.tsec_scu_user;
create table 530_to_532.tsec_scu_user
( 
    scu_user_id                   integer not null,
    scu_active                    char,
    scu_username                  varchar(400) not null,
    scu_password                  varchar(32),
    scu_first_name                varchar(100),
    scu_last_name                 varchar(100),
    scu_company_id                integer not null,
    scu_user_phone                varchar(20),
    scu_user_address              varchar(200),
    scu_user_email                varchar(40),
    scu_user_title                varchar(40),
    scu_user_fax                  varchar(20),
    scu_log_flag                  integer,
    scu_ldap_flag                 char,
    scu_notify_email              varchar(40),
    scu_ldap_entry_dn             varchar(750),
    scu_ldap_svr_url              varchar(800),
    constraint scu_0_pk
        primary key (scu_user_id),
    constraint scu_1_uk
        unique (scu_username, scu_company_id)
) 

in users index in indx;



drop synonym 530_to_532.scu;
create synonym 530_to_532.scu for 530_to_532.tsec_scu_user;

-- ===================================================================
--
-- Table tsec_ust_user_setting
--
-- The user settings is an add-on to the security infrastructure and does not deal with
-- authentication or authorization, but with default values, user preferences, etc.
-- ===================================================================

drop table 530_to_532.tsec_ust_user_setting;
create table 530_to_532.tsec_ust_user_setting
( 
    ust_company_id                integer,
    ust_user_id                   integer,
    ust_user_settable             char,
    ust_setting                   varchar(100),
    ust_instance                  varchar(100),
    ust_value                     varchar(3000)
) 

in users index in indx;



drop synonym 530_to_532.ust;
create synonym 530_to_532.ust for 530_to_532.tsec_ust_user_setting;

-- ===================================================================
--
-- Table tsec_lot_login_times
--
-- This table contains information about successful logins and subsequent logouts for
-- users. Both the login and logout times are stored as well as the logout method, saved
-- in the field 'logout_method' which can currently hold the following values:
-- T - if a session timeout occurred
-- U - if the user manually logged out of the app
-- S - if some kind of system error occurred.
-- ===================================================================

drop table 530_to_532.tsec_lot_login_times;
create table 530_to_532.tsec_lot_login_times
( 
    lot_session_id                integer,
    lot_user_id                   integer,
    lot_company_id                integer,
    lot_login_time                timestamp,
    lot_logout_time               timestamp,
    lot_logout_method             varchar(1),
    lot_service_name              varchar(100)
) 

in users index in indx;



drop synonym 530_to_532.lot;
create synonym 530_to_532.lot for 530_to_532.tsec_lot_login_times;

-- ===================================================================
--
-- Table tsec_cmp_company
--
-- All companies are kept in this table. This includes Trigo, all
-- marketplaces and Trigo customers.
-- The type is one of the following values:
-- 'T' Trigo
-- 'M' Marketplace
-- 'S' Supplier
-- We expect that the type will evolve since we would want to keep
-- track of the different e-commerce models that each marketplace
-- supports. We might also want to keep more information about the
-- supplier.
-- Also, the company_id is generated from two sequences so that
-- we can distinguish the company in other tables.
-- ===================================================================

drop table 530_to_532.tsec_cmp_company;
create table 530_to_532.tsec_cmp_company
( 
    cmp_company_id                integer not null,
    cmp_company_name              varchar(60),
    cmp_company_code              varchar(20),
    cmp_company_type              char,
    cmp_directory                 varchar(1000),
    cmp_company_url               varchar(200),
    constraint cmp_0_pk
        primary key (cmp_company_id)
) 

in users index in indx;



drop synonym 530_to_532.cmp;
create synonym 530_to_532.cmp for 530_to_532.tsec_cmp_company;

-- ===================================================================
--
-- Table tsec_lnk_mylinks
--
-- User's personnal links are kept here. The lnk_link is a string
-- the should match one of the ids on 530_to_532.the menu.xml file
-- ===================================================================

drop table 530_to_532.tsec_lnk_mylinks;
create table 530_to_532.tsec_lnk_mylinks
( 
    lnk_company_id                integer not null,
    lnk_user_id                   integer not null,
    lnk_link                      varchar(200) not null,
    lnk_creation_date             timestamp,
    constraint lnk_0_pk
        primary key (lnk_company_id, lnk_user_id, lnk_link)
) 

in users index in indx;



drop synonym 530_to_532.lnk;
create synonym 530_to_532.lnk for 530_to_532.tsec_lnk_mylinks;

-- ===================================================================
--
-- Table tsec_log_useractivity
--

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

drop table 530_to_532.tsec_log_useractivity;
create table 530_to_532.tsec_log_useractivity
( 
    log_user_id                   integer,
    log_company_id                integer,
    log_page_id                   integer,
    log_date                      timestamp
) 

in users index in indx;



drop synonym 530_to_532.log;
create synonym 530_to_532.log for 530_to_532.tsec_log_useractivity;

-- ===================================================================
--
-- Table tsec_oac_object_action
--
-- Object Actions may have company_type assigned to them, to reflect that
-- the actions on objects applies to all the companies of that type.
-- The Company type is one of the following values:
-- 'T' Trigo
-- 'M' Marketplace
-- 'S' Supplier
-- ===================================================================

drop table 530_to_532.tsec_oac_object_action;
create table 530_to_532.tsec_oac_object_action
( 
    oac_id                        integer not null,
    oac_name                      varchar(60),
    oac_desc                      varchar(200),
    oac_object_type_id            integer,
    oac_company_type              char,
    oac_default_obg               char,
    constraint oac_0_pk
        primary key (oac_id)
) 

in users index in indx;



drop synonym 530_to_532.oac;
create synonym 530_to_532.oac for 530_to_532.tsec_oac_object_action;

-- ===================================================================
--
-- Table tsec_rol_role
--

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

drop table 530_to_532.tsec_rol_role;
create table 530_to_532.tsec_rol_role
( 
    rol_company_id                integer,
    rol_role_id                   integer not null,
    rol_role_name                 varchar(100),
    rol_role_desc                 varchar(200),
    constraint rol_0_pk
        primary key (rol_role_id)
) 

in users index in indx;



drop synonym 530_to_532.rol;
create synonym 530_to_532.rol for 530_to_532.tsec_rol_role;

-- ===================================================================
--
-- Table tsec_rat_role_attributes
--

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

drop table 530_to_532.tsec_rat_role_attributes;
create table 530_to_532.tsec_rat_role_attributes
( 
    rat_company_id                integer,
    rat_role_id                   integer,
    rat_name                      varchar(100),
    rat_attr_value                varchar(900),
    rat_row_order                 integer
) 

in users index in indx;



drop synonym 530_to_532.rat;
create synonym 530_to_532.rat for 530_to_532.tsec_rat_role_attributes;

-- ===================================================================
--
-- Table tsec_urm_user_role_map
--

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

drop table 530_to_532.tsec_urm_user_role_map;
create table 530_to_532.tsec_urm_user_role_map
( 
    urm_company_id                integer,
    urm_user_id                   integer,
    urm_role_id                   integer,
    urm_role_request_flag         char
) 

in users index in indx;



drop synonym 530_to_532.urm;
create synonym 530_to_532.urm for 530_to_532.tsec_urm_user_role_map;

-- ===================================================================
--
-- Table tsec_obt_object_type
--

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

drop table 530_to_532.tsec_obt_object_type;
create table 530_to_532.tsec_obt_object_type
( 
    obt_id                        integer,
    obt_name                      varchar(60),
    obt_desc                      varchar(200),
    obt_default_obg               char
) 

in users index in indx;



drop synonym 530_to_532.obt;
create synonym 530_to_532.obt for 530_to_532.tsec_obt_object_type;

-- ===================================================================
--
-- Table tsec_cot_company_attrib
--
-- This table stores attributes of a company
-- ===================================================================

drop table 530_to_532.tsec_cot_company_attrib;
create table 530_to_532.tsec_cot_company_attrib
( 
    cot_company_id                integer,
    cot_attrib_name               varchar(100),
    cot_attrib_value              varchar(3000)
) 

in users index in indx;



drop synonym 530_to_532.cot;
create synonym 530_to_532.cot for 530_to_532.tsec_cot_company_attrib;

-- ===================================================================
--
-- Table tsec_cap_ctg_access_prv
--
-- This table stores catalog access for each node of a catalog 1:view 0:noview
-- ===================================================================

drop table 530_to_532.tsec_cap_ctg_access_prv;
create table 530_to_532.tsec_cap_ctg_access_prv
( 
    cap_company_id                integer,
    cap_cap_id                    integer not null,
    cap_attr_group_id             integer not null,
    cap_viewable                  char,
    constraint cap_0_uk
        unique (cap_cap_id, cap_attr_group_id)
) 

in users index in indx;



drop synonym 530_to_532.cap;
create synonym 530_to_532.cap for 530_to_532.tsec_cap_ctg_access_prv;

-- ===================================================================
--
-- Table tsec_cma_cap_role_object_map
--
-- This table stores the objects/role combinations for which ctg access privileges
-- are enabled.
-- ===================================================================

drop table 530_to_532.tsec_cma_cap_role_object_map;
create table 530_to_532.tsec_cma_cap_role_object_map
( 
    cma_company_id                integer,
    cma_role_id                   integer not null,
    cma_object_id                 integer not null,
    cma_object_type               varchar(100) not null,
    cma_cap_id                    integer not null,
    constraint cma_0_pk
        primary key (cma_role_id, cma_object_id, cma_object_type),
    constraint cma_1_uk
        unique (cma_cap_id)
) 

in users index in indx;



drop synonym 530_to_532.cma;
create synonym 530_to_532.cma for 530_to_532.tsec_cma_cap_role_object_map;

-- ===================================================================
--
-- Table tsec_cvd_ctg_view_detail
--
-- This table stores the details of a catalog view for each attribute group of a catalog 1:view 0:noview
-- ===================================================================

drop table 530_to_532.tsec_cvd_ctg_view_detail;
create table 530_to_532.tsec_cvd_ctg_view_detail
( 
    cvd_company_id                integer,
    cvd_view_id                   integer,
    cvd_attr_group_id             integer,
    cvd_sub_view_type             varchar(100),
    cvd_sub_view_id               integer,
    cvd_viewable                  char,
    cvd_order                     integer
) 

in users index in indx;



drop synonym 530_to_532.cvd;
create synonym 530_to_532.cvd for 530_to_532.tsec_cvd_ctg_view_detail;

-- ===================================================================
--
-- Table tsec_cvi_ctg_view
--
-- This table stores the list of catalog views
-- ===================================================================

drop table 530_to_532.tsec_cvi_ctg_view;
create table 530_to_532.tsec_cvi_ctg_view
( 
    cvi_company_id                integer not null,
    cvi_object_id                 integer not null,
    cvi_object_type               varchar(100) not null,
    cvi_view_name                 varchar(256) not null,
    cvi_view_id                   integer,
    constraint cvi_0_uk
        unique (cvi_company_id, cvi_object_id, cvi_object_type, cvi_view_name)
) 

in users index in indx;



drop synonym 530_to_532.cvi;
create synonym 530_to_532.cvi for 530_to_532.tsec_cvi_ctg_view;

-- ===================================================================
--
-- Table tsec_cdu_default_view_user
--
-- This table stores the default views for each user
-- ===================================================================

drop table 530_to_532.tsec_cdu_default_view_user;
create table 530_to_532.tsec_cdu_default_view_user
( 
    cdu_company_id                integer not null,
    cdu_user_id                   integer not null,
    cdu_object_id                 integer not null,
    cdu_object_type               varchar(900) not null,
    cdu_view_id                   integer,
    constraint cdu_0_uk
        unique (cdu_company_id, cdu_user_id, cdu_object_id, cdu_object_type)
) 

in users index in indx;



drop synonym 530_to_532.cdu;
create synonym 530_to_532.cdu for 530_to_532.tsec_cdu_default_view_user;

-- ===================================================================
--
-- Table tsec_obg_object_group
--

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

drop table 530_to_532.tsec_obg_object_group;
create table 530_to_532.tsec_obg_object_group
( 
    obg_company_id                integer,
    obg_id                        integer not null,
    obg_name                      varchar(100),
    obg_description               varchar(200),
    constraint obg_0_pk
        primary key (obg_id)
) 

in users index in indx;



drop synonym 530_to_532.obg;
create synonym 530_to_532.obg for 530_to_532.tsec_obg_object_group;

-- ===================================================================
--
-- Table tsec_ogm_object_group_map
--

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

drop table 530_to_532.tsec_ogm_object_group_map;
create table 530_to_532.tsec_ogm_object_group_map
( 
    ogm_company_id                integer,
    ogm_object_group_id           integer,
    ogm_object_type_id            integer
) 

in users index in indx;



drop synonym 530_to_532.ogm;
create synonym 530_to_532.ogm for 530_to_532.tsec_ogm_object_group_map;

-- ===================================================================
--
-- Table tsec_orm_object_group_role_map
--
-- 'access' is a bitmap of all the object actions in the system. 'access_order' determines the order of the
-- 'access' sequence for a whole list of actions for a role. This helps to have an unlimited
-- size for 530_to_532.the actions bitmap 'access' using 'access_order' (similar to a multi-dimensional array).
-- However, in the object_group_role_map table, 'access' only has the bits corresponding to the
-- actions of the current object_group active!
-- ===================================================================

drop table 530_to_532.tsec_orm_object_group_role_map;
create table 530_to_532.tsec_orm_object_group_role_map
( 
    orm_company_id                integer,
    orm_object_group_id           integer,
    orm_role_id                   integer,
    orm_access                    varchar(4000),
    orm_access_order              integer
) 

in users index in indx;



drop synonym 530_to_532.orm;
create synonym 530_to_532.orm for 530_to_532.tsec_orm_object_group_role_map;

-- ===================================================================
--
-- Table tsec_rsm_role_to_script_map
--
-- Tables that maps role id to script names that the particular role has access to.
-- ===================================================================

drop table 530_to_532.tsec_rsm_role_to_script_map;
create table 530_to_532.tsec_rsm_role_to_script_map
( 
    rsm_company_id                integer,
    rsm_role_id                   integer,
    rsm_script_name               varchar(500)
) 

in users index in indx;



drop synonym 530_to_532.rsm;
create synonym 530_to_532.rsm for 530_to_532.tsec_rsm_role_to_script_map;




-- ===================================================================
--
-- Table tsyn_agr_attr_group
--

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

drop table 530_to_532.tsyn_agr_attr_group;
create table 530_to_532.tsyn_agr_attr_group
( 
    agr_attr_group_id             integer not null,
    agr_cmp_id                    integer,
    agr_attr_group_name           varchar(100),
    constraint agr_0_pk
        primary key (agr_attr_group_id)
) 

in users index in indx;



drop synonym 530_to_532.agr;
create synonym 530_to_532.agr for 530_to_532.tsyn_agr_attr_group;

-- ===================================================================
--
-- Table tsyn_ago_attr_group_detail
--

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

drop table 530_to_532.tsyn_ago_attr_group_detail;
create table 530_to_532.tsyn_ago_attr_group_detail
( 
    ago_attr_group_id             integer,
    ago_cmp_id                    integer,
    ago_spec_id                   integer,
    ago_node_id                   integer
) 

in users index in indx;



drop synonym 530_to_532.ago;
create synonym 530_to_532.ago for 530_to_532.tsyn_ago_attr_group_detail;

-- ===================================================================
--
-- Table tucp_ucp_usage_detail
--
-- Contains the usage event.
-- ===================================================================

drop table 530_to_532.tucp_ucp_usage_detail;
create table 530_to_532.tucp_ucp_usage_detail
( 
    ucp_company_id                integer,
    ucp_usage_name                varchar(100),
    ucp_usage_time                timestamp,
    ucp_usage_count               integer
) 

in users index in indx;



drop synonym 530_to_532.ucp;
create synonym 530_to_532.ucp for 530_to_532.tucp_ucp_usage_detail;







-- ===================================================================
--
-- Table tusg_usg_usage_event
--
-- Contains the usage event.
-- ===================================================================

drop table 530_to_532.tusg_usg_usage_event;
create table 530_to_532.tusg_usg_usage_event
( 
    usg_company_id                integer,
    usg_event_name                varchar(100),
    usg_timestamp                 timestamp,
    usg_user_id                   integer,
    usg_description               varchar(2000)
) 

in users index in indx;



drop synonym 530_to_532.usg;
create synonym 530_to_532.usg for 530_to_532.tusg_usg_usage_event;







-- ===================================================================
--
-- Table tusr_usr_usage_report
--

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

drop table 530_to_532.tusr_usr_usage_report;
create table 530_to_532.tusr_usr_usage_report
( 
    usr_company_id                integer,
    usr_date                      timestamp,
    usr_data_type                 varchar(100),
    usr_value                     integer
) 

in users index in indx;



drop synonym 530_to_532.usr;
create synonym 530_to_532.usr for 530_to_532.tusr_usr_usage_report;







-- ===================================================================
--
-- Table tutl_lck_lock
--
-- There are two lock type -- slave(S) lock and master(M) lock
-- This is an application control table and does not contain any
-- customer specific data,  Therefore it does not have a company_id
-- ===================================================================
drop table 530_to_532.tutl_lck_lock;
create table 530_to_532.tutl_lck_lock
( 
    lck_object_id                 integer not null,
    lck_object_type               varchar(50) not null,
    lck_type                      char not null,
    lck_read_counter              integer not null,
    lck_thread_id                 varchar(200) not null,
    lck_jvm_id                    varchar(200) not null,
    constraint lck_0_uk
        unique (lck_object_id, lck_object_type, lck_type, lck_read_counter)
) 

in users index in indx;

drop synonym 530_to_532.lck;
create synonym 530_to_532.lck for 530_to_532.tutl_lck_lock;

-- ===================================================================
--
-- Table tutl_jhb_jvm_heartbeat
--
-- This is an application control table and does not contain any
-- customer specific data,  Therefore it does not have a company_id
-- ===================================================================

drop table 530_to_532.tutl_jhb_jvm_heartbeat;
create table 530_to_532.tutl_jhb_jvm_heartbeat
( 
    jhb_jvm_id                    varchar(200),
    jhb_heartbeat                 timestamp,
    jhb_jvm_type                  varchar(200)
) 

in users index in indx;



drop synonym 530_to_532.jhb;
create synonym 530_to_532.jhb for 530_to_532.tutl_jhb_jvm_heartbeat;

drop table 530_to_532.dual;
create table 530_to_532.dual (dummy varchar(1) not null) in users;


-- ===================================================================
--
-- Table twbs_wbs_webservice
--
-- Represents a web service.
-- ===================================================================

drop table 530_to_532.twbs_wbs_webservice;
create table 530_to_532.twbs_wbs_webservice
( 
    wbs_id                        integer not null,
    wbs_cmp_id                    integer,
    wbs_name                      varchar(100) not null,
    wbs_implclass                 varchar(2000),
    wbs_desc                      varchar(2000),
    wbs_url                       varchar(2000),
    wbs_wsdl_url                  varchar(2000),
    wbs_wsdl_doc_path             varchar(100),
    wbs_wsdd_doc_path             varchar(100),
    wbs_protocol                  varchar(50),
    wbs_style                     varchar(50),
    wbs_impl_script_path          varchar(2000),
    wbs_store_incoming            char,
    wbs_store_outgoing            char,
    wbs_deployed                  char,
    wbs_auth_required             char,
    constraint wbs_0_pk
        primary key (wbs_id),
    constraint wbs_1_uk
        unique (wbs_name)
) 

in users index in indx;



drop synonym 530_to_532.wbs;
create synonym 530_to_532.wbs for 530_to_532.twbs_wbs_webservice;
-- ===================================================================
--
-- Table twbs_wtr_transaction
--
-- Represents a web service transaction
-- ===================================================================

drop table 530_to_532.twbs_wtr_transaction;
create table 530_to_532.twbs_wtr_transaction
( 
    wtr_id                        integer not null,
    wtr_wbs_id                    integer,
    wtr_cmp_id                    integer,
    wtr_incoming_path             varchar(2000),
    wtr_outgoing_path             varchar(2000),
    wtr_arrival_time              timestamp,
    constraint wtr_0_pk
        primary key (wtr_id)
) 

in users index in indx;



drop synonym 530_to_532.wtr;
create synonym 530_to_532.wtr for 530_to_532.twbs_wtr_transaction;




-- ===================================================================
--
-- Table twfl_std_step_def
--
-- step definition.
-- ===================================================================

drop table 530_to_532.twfl_std_step_def;
create table 530_to_532.twfl_std_step_def
( 
    std_cmp_id                    integer,
    std_wfl_id                    integer,
    std_id                        integer,
    std_name                      varchar(200),
    std_desc                      varchar(3000),
    std_type                      varchar(100),
    std_script_path               varchar(1000),
    std_deadline_date             timestamp,
    std_deadline_duration         bigint,
    std_entry_notification        varchar(3000),
    std_deadline_notification     varchar(3000),
    std_allow_add_entries         char(1),
    std_recategorize              char(1),
    std_allow_reserve_entries     char(1),
    std_view_id                   integer
) 

in users index in indx;



drop synonym 530_to_532.std;
create synonym 530_to_532.std for 530_to_532.twfl_std_step_def;

-- ===================================================================
--
-- Table twfl_stl_step_loc_hierarchy
--
-- step location hierarchy
-- ===================================================================

drop table 530_to_532.twfl_stl_step_loc_hierarchy;
create table 530_to_532.twfl_stl_step_loc_hierarchy
( 
    stl_cmp_id                    integer,
    stl_step_id                   integer,
    stl_loc_hierarchy_id          integer,
    stl_modify_availability       char(1)
) 

in users index in indx;



drop synonym 530_to_532.stl;
create synonym 530_to_532.stl for 530_to_532.twfl_stl_step_loc_hierarchy;

-- ===================================================================
--
-- Table twfl_stp_step_performer
--
-- step performers
-- ===================================================================

drop table 530_to_532.twfl_stp_step_performer;
create table 530_to_532.twfl_stp_step_performer
( 
    stp_cmp_id                    integer,
    stp_step_id                   integer,
    stp_role_id                   integer,
    stp_user_id                   integer
) 

in users index in indx;



drop synonym 530_to_532.stp;
create synonym 530_to_532.stp for 530_to_532.twfl_stp_step_performer;

-- ===================================================================
--
-- Table twfl_ste_step_exit_value
--
-- step exit values for each entry exiting a step.
-- ===================================================================

drop table 530_to_532.twfl_ste_step_exit_value;
create table 530_to_532.twfl_ste_step_exit_value
( 
    ste_cmp_id                    integer,
    ste_step_id                   integer,
    ste_exit_value                varchar(200)
) 

in users index in indx;



drop synonym 530_to_532.ste;
create synonym 530_to_532.ste for 530_to_532.twfl_ste_step_exit_value;

-- ===================================================================
--
-- Table twfl_stg_step_attr_group
--
-- step attribute groups ids.
-- Attribute Groups on which a step is supposed to apply.
-- ===================================================================

drop table 530_to_532.twfl_stg_step_attr_group;
create table 530_to_532.twfl_stg_step_attr_group
( 
    stg_cmp_id                    integer,
    stg_step_id                   integer,
    stg_attr_group_id             integer,
    stg_viewable_flag             char(1)
) 

in users index in indx;



drop synonym 530_to_532.stg;
create synonym 530_to_532.stg for 530_to_532.twfl_stg_step_attr_group;

-- ===================================================================
--
-- Table twfl_wfd_workflow_def
--
-- workflow definition.
-- just basic info.
-- the real structure is in the workflow graph
-- gui_available tells you whether a gui is present for 530_to_532.this wfl or not
-- T -> true
-- F -> false
-- ===================================================================

drop table 530_to_532.twfl_wfd_workflow_def;
create table 530_to_532.twfl_wfd_workflow_def
( 
    wfd_cmp_id                    integer,
    wfd_id                        integer,
    wfd_name                      varchar(200),
    wfd_desc                      varchar(3000),
    wfd_container_type            varchar(200),
    wfd_gui_available             char,
    wfd_object_group_id           integer
) 

in users index in indx;



drop synonym 530_to_532.wfd;
create synonym 530_to_532.wfd for 530_to_532.twfl_wfd_workflow_def;

-- ===================================================================
--
-- Table twfl_wfg_workflow_graph
--
-- workflow graph.
-- defines the destination step for each exit value of the source step,
-- ===================================================================

drop table 530_to_532.twfl_wfg_workflow_graph;
create table 530_to_532.twfl_wfg_workflow_graph
( 
    wfg_cmp_id                    integer,
    wfg_wfl_id                    integer,
    wfg_src_step_id               integer,
    wfg_exit_value                varchar(200),
    wfg_dst_step_id               integer
) 

in users index in indx;



drop synonym 530_to_532.wfg;
create synonym 530_to_532.wfg for 530_to_532.twfl_wfg_workflow_graph;

-- ===================================================================
--
-- Table twfl_spt_step_path
--
-- Step path and workflow hierarchy information.
-- For all pairs (R, W) of workflows R and W such that W is nested at some depth within R,
-- there is one row in this table for every top-level step of W.
-- In other words, for each such pair (R, W), and for each step S of W,
-- there is a row (R, W, S) in this table
-- Since we may say any workflow is nested at depth zero within itself,
-- the set of all (R, W) includes the pair (W, W) for every workflow W.
-- In a table row (R, W, S), root_wfl_id is the id of R, leaf_parent_step_id is the step id
-- of W as a top-level (NestedWorkflowStep) step of its parent workflow P that is
-- nested within R, if any (-1 when W = R; positive value when W < P <= R),
-- leaf_wfl_id is the id of W,
-- leaf_step_id is the step id of S in W, leaf_step_path is the full numerical path of S for
-- this particular nesting of W within R, and leaf_step_text_path is the text path of
-- this particular nesting of W within R.
-- For each (and every) instance of one workflow being nested at any depth within another,
-- there is one row in this table for each step of the nested workflow,
-- whose root_wfl_id is the id of the enclosing workflow.
-- Note that for 530_to_532.the purposes of populating this table, we consider every workflow to "be nested within itself",
-- and so to generate one row in this table for each of its steps, in which its id is both
-- root_wfl_id and leaf_wfl_id.
-- cmp_id is company id.
-- id is an arbitrary sequential id for 530_to_532.the rows of this table.
-- root_wfl_id is the workflow id of the enclosing workflow, for 530_to_532.this particular pair of (enclosing, nested) workflows.
-- leaf_parent_step_id is the step id of the NestedWorkflowStep that represents the nested workflow
-- as a top-level step of the immediately enclosing workflow
-- (note that the "immediately enclosing workflow" in general is itself a nested workflow within the
-- workflow that is root workflow here).
-- leaf_wfl_id is the id of the nested workflow that is the subject of this particular table row.
-- leaf_step_id is the id of the particular step (as a top level step) of the nested workflow
-- that this table row corresponds to.
-- leaf_step_path is the "full (numerical) path" /WFLID1.STEPID1/WFLID2.STEPID2/.../WFLIDN.STEPIDN
-- of the step (as a top level step of the nested workflow) whose (step) id is leaf_step_id.
-- Note that root_wfl_id, leaf_parent_step_id, leaf_wfl_id, and leaf_step_id will all occur
-- within this path.
-- leaf_step_text_path is the text representation of the path.
-- ===================================================================

drop table 530_to_532.twfl_spt_step_path;
create table 530_to_532.twfl_spt_step_path
( 
    spt_cmp_id                    integer,
    spt_id                        integer,
    spt_root_wfl_id               integer,
    spt_leaf_parent_step_id       integer,
    spt_leaf_wfl_id               integer,
    spt_leaf_step_id              integer,
    spt_leaf_step_path            varchar(400),
    spt_leaf_step_text_path       varchar(1000)
) 

in users index in indx;



drop synonym 530_to_532.spt;
create synonym 530_to_532.spt for 530_to_532.twfl_spt_step_path;

-- ===================================================================
--
-- Table twfl_coa_collaboration_area
--
-- Collaboration area is an object similar to a container, but used for 530_to_532.temporary
-- manipulation of the entries through a workflow, before the entries are
-- checked back in to the source container.
-- cmp_id is company id.
-- id is collaboration area id.
-- name is collaboration area name.
-- desc is collaboration area description.
-- wfl_id is workflow id that the collaboration area uses.
-- src_container_id is the id of the source container for which the current collaboration
-- area is created.
-- dst_container_id is the id of the destination container, which is created for 530_to_532.the
-- manipulation of the temporary entries of the current collaboration area.
-- deadline_date is the deadline for 530_to_532.the col. area stored as a date.
-- deadline_duration is the deadline for 530_to_532.the col. area stored as a number
-- specifying the duration. At any time, either a deadline_date or
-- a deadline_duration are set but not both.
-- is_locked is a flag recording whether the col. area is locked (flag = 'Y'),
-- i.e. col. area is in an non-editable state,
-- versus being in unlocked state and thus unavailable for editing (flag = 'N').
-- delete_on_empty is a flag recording whether the col. area should be deleted
-- after the last entry which enters it leaves (flag = 'Y'),
-- versus the col. area should be not deleted automatically (flag = 'N').
-- ===================================================================

drop table 530_to_532.twfl_coa_collaboration_area;
create table 530_to_532.twfl_coa_collaboration_area
( 
    coa_cmp_id                    integer,
    coa_id                        integer,
    coa_name                      varchar(200),
    coa_desc                      varchar(3000),
    coa_container_type            varchar(200),
    coa_wfl_id                    integer,
    coa_src_container_id          integer,
    coa_dst_container_id          integer,
    coa_admin_users               varchar(3000),
    coa_admin_roles               varchar(3000),
    coa_deadline_date             timestamp,
    coa_deadline_duration         bigint,
    coa_is_locked                 char,
    coa_delete_on_empty           char,
    coa_object_group_id           integer
) 

in users index in indx;



drop synonym 530_to_532.coa;
create synonym 530_to_532.coa for 530_to_532.twfl_coa_collaboration_area;

-- ===================================================================
--
-- Table twfl_cae_coll_area_entry
--
-- Collaboration area entry, i.e. an entry having entered a particular
-- step (having a particular full step path)
-- of a particular workflow that is bound to a collaboration area.
-- cmp_id is company id.
-- ca_id is collaboration area id.
-- entry_id is entry id in collaboration area container.
-- step_path_id is a foreign key to "full path" /WFLID1.STEPID1/WFLID2.STEPID2/.../WFLIDN.STEPIDN
-- of the step that this entry is in, as a row of twfl_wfh_workflow_hierarchy
-- deadline is the absolute value of the deadline for 530_to_532.this entry in this step.
-- deadline_step_path_id is either a foreign key to the "full path" /WFLID1.STEPID1/WFLID2.STEPID2/.../WFLIDN.STEPIDN
-- of the "effective" deadline step, i.e. the workflow step that has determined the effective deadline
-- for 530_to_532.this CAE entry, or Checks.PATH_ID_DEFAULT_VALUE, to indicate that the effective deadline
-- has been determined by the collaboration area's deadline.
-- data is an encoded string capturing the state of approvals so far for 530_to_532.this entry
-- in this step (only used by "and approval" steps).
-- 
-- available is a flag recording whether the entry is stable (flag = 'Y'),
-- i.e. stably in' a particular state and thus available to the GUI,
-- versus being in transition between states and thus unavailable to the GUI (flag = 'N').
-- lock_id specifies the id of the entry in the collaboration entry lock
-- table (cel) for 530_to_532.the current entry of the collaboration area.
-- ===================================================================

drop table 530_to_532.twfl_cae_coll_area_entry;
create table 530_to_532.twfl_cae_coll_area_entry
( 
    cae_cmp_id                    integer,
    cae_ca_id                     integer,
    cae_entry_id                  integer not null,
    cae_step_path_id              integer not null,
    cae_deadline_step_path_id     integer,
    cae_deadline                  timestamp,
    cae_data                      varchar(3000),
    cae_available                 char,
    cae_lock_id                   integer,
    constraint cae_0_uk
        unique (cae_entry_id, cae_step_path_id)
) 

in users index in indx;



drop synonym 530_to_532.cae;
create synonym 530_to_532.cae for 530_to_532.twfl_cae_coll_area_entry;

-- ===================================================================
--
-- Table twfl_csj_coll_area_step_job
--
-- Collaboration area step jobs.  These are jobs started by the "CollaborationArea::runStepJob" script operation.
-- Each invocation of that script operation generates one or more rows in this table.
-- cmp_id is company id.
-- ca_id is collaboration area id.
-- entry_id is the id of an entry in collaboration area container.  The relationship between such
-- entries and the started jobs is arbitrary, i.e. up to the invoker of the runStepJob operation.
-- step_path_id is the id of a row in the SPT table.
-- job_id is the id of the referenced job in the SCJ table.
-- job_name is the name of the feed or syndication as it appears in the respective console,
-- i.e. the value of FEE_NAME or SYN_NAME column in TCTG_FEE_FEED or TCTG_SYN_SYNDICATION.
-- job_type is a string which identifies the job type, such as "IMPORT" or "EXPORT".  The allowable
-- values of such strings are defined by the definition and implementation of the runStepJob operation.
-- job_date is the absolute value of the date at which the job should be run.
-- schedule_id is the id in the SCH table of the run-once schedule created to run this job (once) at job_date.
-- ===================================================================

drop table 530_to_532.twfl_csj_coll_area_step_job;
create table 530_to_532.twfl_csj_coll_area_step_job
( 
    csj_cmp_id                    integer,
    csj_ca_id                     integer,
    csj_entry_id                  integer,
    csj_step_path_id              integer,
    csj_job_id                    integer,
    csj_job_name                  varchar(200),
    csj_job_type                  varchar(200),
    csj_job_date                  timestamp,
    csj_schedule_id               integer
) 

in users index in indx;



drop synonym 530_to_532.csj;
create synonym 530_to_532.csj for 530_to_532.twfl_csj_coll_area_step_job;

-- ===================================================================
--
-- Table twfl_cem_coll_entry_mapping
--
-- Keeps the mapping between the collaboration area entry and the entry in the source catalog
-- cmp_id is company id.
-- ca_id is collaboration area id.
-- ca_entry_id is entry id in collaboration area catalog.
-- src_ctg_id is catalog id of source catalog.
-- src_entry_id is entry id in source container.
-- ===================================================================

drop table 530_to_532.twfl_cem_coll_entry_mapping;
create table 530_to_532.twfl_cem_coll_entry_mapping
( 
    cem_cmp_id                    integer,
    cem_ca_id                     integer,
    cem_ca_entry_id               integer,
    cem_src_ctg_id                integer,
    cem_src_entry_id              integer
) 

in users index in indx;



drop synonym 530_to_532.cem;
create synonym 530_to_532.cem for 530_to_532.twfl_cem_coll_entry_mapping;

-- ===================================================================
--
-- Table twfl_ceh_coll_entry_history
--
-- Collaboration entry history.
-- entry_key is intended to be a database-independent, human-readable key for 530_to_532.the entry,
-- for example SKU for items.  Ideally it is nevertheless an actual unique database key
-- for 530_to_532.the entry.
-- event should be a relatively short, human-readable string that specifies what
-- sort of event has occurred in the life history of the entry.
-- step_path is the path of the step "at" which, or "in the neighborhood" of which, this event occurred.
-- data is flattened attributes.
-- ===================================================================

drop table 530_to_532.twfl_ceh_coll_entry_history;
create table 530_to_532.twfl_ceh_coll_entry_history
( 
    ceh_cmp_id                    integer,
    ceh_id                        integer,
    ceh_date                      timestamp,
    ceh_entry_key                 varchar(300),
    ceh_ca_name                   varchar(100),
    ceh_wfl_name                  varchar(100),
    ceh_user_name                 varchar(20),
    ceh_step_path                 varchar(3000),
    ceh_event                     varchar(100),
    ceh_data                      varchar(900),
    ceh_row_order                 integer
) 

in users index in indx;



drop synonym 530_to_532.ceh;
create synonym 530_to_532.ceh for 530_to_532.twfl_ceh_coll_entry_history;


-- ===================================================================
--
-- Table twfl_cel_coll_entry_lock
--
-- Collaboration entry lock. A lock for an entry (specified by
-- the column entry_id) from a collaboration area.
-- Later on, entries from main containers (catalogs, categoryTrees) might be
-- locked too! Hence the column container_type.
-- A lock is acquired by an user (specified by an user_id) at a particular
-- time (specified by the time_acquired).
-- A lock might expire as specified by the column time_of_expiry,
-- after it has been acquired.
-- The column step_path_id specifies the id of the step path at which the
-- lock has been acquired for a given entry of a collaboration area.
-- ===================================================================

drop table 530_to_532.twfl_cel_coll_entry_lock;
create table 530_to_532.twfl_cel_coll_entry_lock
( 
    cel_cmp_id                    integer,
    cel_id                        integer,
    cel_user_id                   integer,
    cel_time_acquired             timestamp,
    cel_time_of_expiry            timestamp,
    cel_container_id              integer,
    cel_container_type            varchar(200),
    cel_entry_id                  integer not null,
    cel_step_path_id              integer not null,
    constraint cel_0_uk
        unique (cel_entry_id, cel_step_path_id),
  constraint cel_fk_1
    foreign key (cel_entry_id, cel_step_path_id)
    references twfl_cae_coll_area_entry (cae_entry_id, cae_step_path_id)
) 

in users index in indx;



drop synonym 530_to_532.cel;
create synonym 530_to_532.cel for 530_to_532.twfl_cel_coll_entry_lock;

-- ===================================================================
--
-- Table twfl_cah_coll_area_history
--
-- Collaboration area history. A row for each signficant event in
-- the life of the collaboration area.
-- Note that twfl_ceh_coll_entry_history is a separate history table
-- for 530_to_532.the individual ITAs in the collaboration area. ca_name is the name of the collaboration area.
-- the action_type is defined in ActionTypeEnum as:
-- - CREATION for collaboration area creation
-- - CHECKOUT for initiation of workflow execution via ITA checkouts
-- - AGGREGATION for starting an aggregation into this collaboration area
-- - ADD for adding new entries into this collaboration area
-- - DELETION for deletion of this collaboration area
-- - CHECKIN for completion of the executing workflow by checking in some or all of its entries
-- - DROP for completion of the executing workflow by checking in some or all of its entries
-- user_name is the name of the performer or perpetrator of this event.
-- date is the timestamp.
-- data is any relevant data that characterizes this event.
-- ===================================================================

drop table 530_to_532.twfl_cah_coll_area_history;
create table 530_to_532.twfl_cah_coll_area_history
( 
    cah_ca_name                   varchar(3000),
    cah_action_type               char,
    cah_user_name                 varchar(3000),
    cah_date                      timestamp,
    cah_data                      varchar(3000)
) 

in users index in indx;



drop synonym 530_to_532.cah;
create synonym 530_to_532.cah for 530_to_532.twfl_cah_coll_area_history;

-- ===================================================================
--
-- Table twfl_wfe_workflow_event
--
-- The WFE table allows for persisting of the previously in-memory workflow events.
-- Unique sequential ID will be used to uniquely identify events as well as to identify
-- the next event for FIFO processing.
-- event types are the classes located in src/java/com.ibm.ccd.workflow/common/events
-- The child WEA records hold the attributes for 530_to_532.the various event types.
-- Status vales are: NEW, PROCESSING, DONE, ERROR
-- start_time -- time event started processing
-- finish_time -- time event finished processing
-- Following are from AbstractWorkflowEvent
-- acquire_lock -- boolean
-- collaboration_area_id
-- 
-- If the status is ERROR, then the  error_message column stores messages and stack traces from failed event processing (in addition to logging the error)
-- Here is the query for getting the next event row for processing
-- select * from wfe where event_id  = (select min(event_id) from wfe where status='NEW') for update;
-- The row retrieved gets updated with the status to PROCESSING so that the row
-- cannot be picked up by another JVM. It is then immediately then committed.
-- ===================================================================

drop table 530_to_532.twfl_wfe_workflow_event;
create table 530_to_532.twfl_wfe_workflow_event
( 
    wfe_cmp_id                    integer,
    wfe_id                        integer,
    wfe_event_type                varchar(50),
    wfe_event_status              varchar(50),
    wfe_start_time                timestamp,
    wfe_finish_time               timestamp,
    wfe_acquire_lock              char,
    wfe_collaboration_area_id     integer,
    wfe_comment                   varchar(3000),
    wfe_source_step_at_path_id    integer,
    wfe_dest_step_at_path_ids     varchar(900),
    wfe_prior_step_at_path_id     integer,
    wfe_deadline_step_at_path_id  integer,
    wfe_exit_value                varchar(3000),
    wfe_user_id                   integer,
    wfe_error_message             varchar(3000),
    wfe_row_order                 integer
) 

in users index in indx;



drop synonym 530_to_532.wfe;
create synonym 530_to_532.wfe for 530_to_532.twfl_wfe_workflow_event;

-- ===================================================================
--
-- Table twfl_wee_workflow_event_entry
--
-- The WEE table allows for persisting the mapping of entries to events, and for storing the
-- status of the processing of entries for an event. This table will be queried by the appserver
-- UI code to refresh the UI status after doing a checkout.
-- ===================================================================

drop table 530_to_532.twfl_wee_workflow_event_entry;
create table 530_to_532.twfl_wee_workflow_event_entry
( 
    wee_event_id                  integer,
    wee_entry_id                  integer,
    wee_event_entry_status        varchar(50)
) 

in users index in indx;



drop synonym 530_to_532.wee;
create synonym 530_to_532.wee for 530_to_532.twfl_wee_workflow_event_entry;








create index 530_to_532.iaud_alo_0 on 530_to_532.taud_alo_audit_log (
        alo_company_id,
        alo_event_name,
        alo_user_id,
        alo_timestamp
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_sen_0 on 530_to_532.tcnt_sen_selected_entry (
        sen_selection_id,
        sen_src_container_id,
        sen_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_cnt_0 on 530_to_532.tcnt_cnt_container (
        cnt_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_cnt_1 on 530_to_532.tcnt_cnt_container (
        cnt_id,
        cnt_name,
        cnt_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_cnt_2 on 530_to_532.tcnt_cnt_container (
        cnt_name,
        cnt_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_cna_0 on 530_to_532.tcnt_cna_container_attributes (
        cna_container_id,
        cna_next_version_id,
        cna_version_id,
        cna_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_cna_1 on 530_to_532.tcnt_cna_container_attributes (
        cna_name,
        cna_value,
        cna_container_id,
        cna_next_version_id,
        cna_version_id,
        cna_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_ent_0 on 530_to_532.tcnt_ent_entry (
        ent_id,
        ent_next_version_id,
        ent_version_id,
        ent_primary_key,
        ent_container_id,
        ent_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_ent_1 on 530_to_532.tcnt_ent_entry (
        ent_primary_key,
        ent_container_id,
        ent_next_version_id,
        ent_version_id,
        ent_id,
        ent_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_ent_2 on 530_to_532.tcnt_ent_entry (
        ent_container_id,
        ent_next_version_id,
        ent_version_id,
        ent_id,
        ent_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_eta_0 on 530_to_532.tcnt_eta_entry_attributes (
        eta_entry_id,
        eta_next_version_id,
        eta_version_id,
        eta_container_id,
        eta_node_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_eta_1 on 530_to_532.tcnt_eta_entry_attributes (
        eta_node_id,
        eta_value_numeric,
        eta_next_version_id,
        eta_version_id,
        eta_container_id,
        eta_entry_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_eta_2 on 530_to_532.tcnt_eta_entry_attributes (
        eta_node_id,
        eta_value_string,
        eta_next_version_id,
        eta_version_id,
        eta_container_id,
        eta_entry_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_esa_0 on 530_to_532.tcnt_esa_entry_sys_attr (
        esa_entry_id,
        esa_next_version_id,
        esa_version_id,
        esa_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_esa_1 on 530_to_532.tcnt_esa_entry_sys_attr (
        esa_name,
        esa_value,
        esa_next_version_id,
        esa_version_id,
        esa_container_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_esa_2 on 530_to_532.tcnt_esa_entry_sys_attr (
        esa_container_id,
        esa_name,
        esa_next_version_id,
        esa_version_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_esm_0 on 530_to_532.tcnt_esm_entry_spec_map (
        esm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_esm_1 on 530_to_532.tcnt_esm_entry_spec_map (
        esm_spec_id,
        esm_next_version_id,
        esm_version_id,
        esm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_esm_2 on 530_to_532.tcnt_esm_entry_spec_map (
        esm_filter_container_id,
        esm_next_version_id,
        esm_version_id,
        esm_company_id,
        esm_spec_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_esm_3 on 530_to_532.tcnt_esm_entry_spec_map (
        esm_container_id,
        esm_next_version_id,
        esm_version_id,
        esm_filter_container_id,
        esm_company_id,
        esm_spec_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_esm_4 on 530_to_532.tcnt_esm_entry_spec_map (
        esm_entry_id,
        esm_next_version_id,
        esm_version_id,
        esm_filter_container_id,
        esm_company_id,
        esm_spec_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_esm_5 on 530_to_532.tcnt_esm_entry_spec_map (
        esm_entry_id,
        esm_version_id,
        esm_next_version_id,
        esm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_efp_0 on 530_to_532.tcnt_efp_entry_full_paths (
        efp_entry_id,
        efp_next_version_id,
        efp_version_id,
        efp_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_efp_1 on 530_to_532.tcnt_efp_entry_full_paths (
        efp_full_path_type,
        efp_full_path,
        efp_next_version_id,
        efp_version_id,
        efp_container_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_efp_2 on 530_to_532.tcnt_efp_entry_full_paths (
        efp_container_id,
        efp_full_path_type,
        efp_next_version_id,
        efp_version_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_ehi_0 on 530_to_532.tcnt_ehi_entry_hierarchy (
        ehi_child_id,
        ehi_next_version_id,
        ehi_version_id,
        ehi_company_id,
        ehi_container_id,
        ehi_parent_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_ehi_1 on 530_to_532.tcnt_ehi_entry_hierarchy (
        ehi_parent_id,
        ehi_next_version_id,
        ehi_version_id,
        ehi_company_id,
        ehi_container_id,
        ehi_child_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_eem_0 on 530_to_532.tcnt_eem_entry_entry_map (
        eem_src_container_id,
        eem_dst_container_id,
        eem_next_version_id,
        eem_version_id,
        eem_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.icnt_eem_1 on 530_to_532.tcnt_eem_entry_entry_map (
        eem_dst_container_id,
        eem_src_container_id,
        eem_next_version_id,
        eem_version_id,
        eem_company_id
)  ALLOW REVERSE SCANS;









create index 530_to_532.ictg_sel_0 on 530_to_532.tctg_sel_selection (
        sel_selection_id,
        sel_catalog_id,
        sel_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_sel_1 on 530_to_532.tctg_sel_selection (
        sel_selection_name,
        sel_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_sel_2 on 530_to_532.tctg_sel_selection (
        sel_catalog_id,
        sel_hidden_flag,
        sel_selection_type,
        sel_version_id,
        sel_selection_id,
        sel_selection_name,
        sel_cat_tree_id,
        sel_object_group_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_dys_0 on 530_to_532.tctg_dys_dynamic_selection (
        dys_selection_id,
        dys_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_sit_0 on 530_to_532.tctg_sit_selected_item (
        sit_selection_id,
        sit_catalog_id,
        sit_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_sca_0 on 530_to_532.tctg_sca_selected_category (
        sca_selection_id,
        sca_catalog_id,
        sca_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_dso_0 on 530_to_532.tctg_dso_data_source (
        dso_id,
        dso_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_dso_1 on 530_to_532.tctg_dso_data_source (
        dso_name,
        dso_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_dsd_0 on 530_to_532.tctg_dsd_data_source_details (
        dsd_datasource_id,
        dsd_name,
        dsd_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_fee_0 on 530_to_532.tctg_fee_feed (
        fee_feed_id,
        fee_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_fee_1 on 530_to_532.tctg_fee_feed (
        fee_ctg_id,
        fee_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_fee_2 on 530_to_532.tctg_fee_feed (
        fee_ctr_id,
        fee_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_fee_3 on 530_to_532.tctg_fee_feed (
        fee_data_source_id,
        fee_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_fee_4 on 530_to_532.tctg_fee_feed (
        fee_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ftf_0 on 530_to_532.tctg_ftf_fetched_files (
        ftf_feed_id,
        ftf_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ftf_1 on 530_to_532.tctg_ftf_fetched_files (
        ftf_filename
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ftf_2 on 530_to_532.tctg_ftf_fetched_files (
        ftf_doc_store_path
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_syn_0 on 530_to_532.tctg_syn_syndication (
        syn_catalog_id,
        syn_version_id,
        syn_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_syn_1 on 530_to_532.tctg_syn_syndication (
        syn_syndication_id,
        syn_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_syn_2 on 530_to_532.tctg_syn_syndication (
        syn_cat_tree_id,
        syn_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_syn_3 on 530_to_532.tctg_syn_syndication (
        syn_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cce_0 on 530_to_532.tctg_cce_ctlg_ctlg_export (
        cce_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cce_1 on 530_to_532.tctg_cce_ctlg_ctlg_export (
        cce_id,
        cce_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cce_2 on 530_to_532.tctg_cce_ctlg_ctlg_export (
        cce_name,
        cce_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cce_3 on 530_to_532.tctg_cce_ctlg_ctlg_export (
        cce_dest_catalog_id,
        cce_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cce_4 on 530_to_532.tctg_cce_ctlg_ctlg_export (
        cce_src_catalog_id,
        cce_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_fi2_0 on 530_to_532.tctg_fi2_file (
        fi2_file_id,
        fi2_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_fi2_1 on 530_to_532.tctg_fi2_file (
        fi2_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_fia_0 on 530_to_532.tctg_fia_file_attribute (
        fia_file_id,
        fia_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ctg_0 on 530_to_532.tctg_ctg_catalog (
        ctg_company_id,
        ctg_id,
        ctg_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ctg_1 on 530_to_532.tctg_ctg_catalog (
        ctg_id,
        ctg_name,
        ctg_object_group_id,
        ctg_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ctg_2 on 530_to_532.tctg_ctg_catalog (
        ctg_name,
        ctg_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ctg_3 on 530_to_532.tctg_ctg_catalog (
        ctg_company_id,
        ctg_type,
        ctg_id,
        ctg_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_caa_0 on 530_to_532.tctg_caa_catalog_attributes (
        caa_catalog_id,
        caa_next_version_id,
        caa_version_id,
        caa_company_id,
        caa_name,
        caa_value
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_caa_1 on 530_to_532.tctg_caa_catalog_attributes (
        caa_name,
        caa_value,
        caa_catalog_id,
        caa_next_version_id,
        caa_version_id,
        caa_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ver_0 on 530_to_532.tctg_ver_version (
        ver_company_id,
        ver_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ver_1 on 530_to_532.tctg_ver_version (
        ver_id,
        ver_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ver_2 on 530_to_532.tctg_ver_version (
        ver_object_id,
        ver_object_type,
        ver_company_id,
        ver_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ver_3 on 530_to_532.tctg_ver_version (
        ver_object_type,
        ver_object_id,
        ver_company_id,
        ver_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_itm_0 on 530_to_532.tctg_itm_item (
        itm_id,
        itm_next_version_id,
        itm_version_id,
        itm_primary_key,
        itm_container_id,
        itm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_itm_1 on 530_to_532.tctg_itm_item (
        itm_primary_key,
        itm_container_id,
        itm_next_version_id,
        itm_version_id,
        itm_id,
        itm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_itm_2 on 530_to_532.tctg_itm_item (
        itm_container_id,
        itm_next_version_id,
        itm_version_id,
        itm_id,
        itm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_itd_0 on 530_to_532.tctg_itd_item_detail (
        itd_item_id,
        itd_next_version_id,
        itd_version_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ita_0 on 530_to_532.tctg_ita_item_attributes (
        ita_item_id,
        ita_next_version_id,
        ita_version_id,
        ita_catalog_id,
        ita_node_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ita_1 on 530_to_532.tctg_ita_item_attributes (
        ita_node_id,
        ita_value_numeric,
        ita_next_version_id,
        ita_version_id,
        ita_catalog_id,
        ita_item_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ita_2 on 530_to_532.tctg_ita_item_attributes (
        ita_node_id,
        ita_value_string,
        ita_next_version_id,
        ita_version_id,
        ita_catalog_id,
        ita_item_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ctr_0 on 530_to_532.tctg_ctr_category_tree (
        ctr_id,
        ctr_name,
        ctr_object_group_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ctr_1 on 530_to_532.tctg_ctr_category_tree (
        ctr_company_id,
        ctr_id,
        ctr_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ctr_2 on 530_to_532.tctg_ctr_category_tree (
        ctr_name,
        ctr_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ctr_3 on 530_to_532.tctg_ctr_category_tree (
        ctr_company_id,
        ctr_type,
        ctr_id,
        ctr_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cta_0 on 530_to_532.tctg_cta_categ_tree_attribute (
        cta_cat_tree_id,
        cta_next_version_id,
        cta_version_id,
        cta_company_id,
        cta_name,
        cta_value
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cta_1 on 530_to_532.tctg_cta_categ_tree_attribute (
        cta_name,
        cta_cat_tree_id,
        cta_next_version_id,
        cta_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cat_0 on 530_to_532.tctg_cat_category (
        cat_id,
        cat_next_version_id,
        cat_version_id,
        cat_container_id,
        cat_primary_key
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cat_1 on 530_to_532.tctg_cat_category (
        cat_container_id,
        cat_next_version_id,
        cat_version_id,
        cat_primary_key,
        cat_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cat_2 on 530_to_532.tctg_cat_category (
        cat_primary_key,
        cat_next_version_id,
        cat_version_id,
        cat_container_id,
        cat_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cat_3 on 530_to_532.tctg_cat_category (
        cat_container_id,
        cat_last_modified,
        cat_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cad_0 on 530_to_532.tctg_cad_category_detail (
        cad_category_id,
        cad_next_version_id,
        cad_version_id,
        cad_container_id,
        cad_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cad_1 on 530_to_532.tctg_cad_category_detail (
        cad_container_id,
        cad_next_version_id,
        cad_version_id,
        cad_category_id,
        cad_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cab_0 on 530_to_532.tctg_cab_category_attributes (
        cab_category_id,
        cab_next_version_id,
        cab_version_id,
        cab_cat_tree_id,
        cab_node_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cab_1 on 530_to_532.tctg_cab_category_attributes (
        cab_node_id,
        cab_value_string,
        cab_next_version_id,
        cab_version_id,
        cab_cat_tree_id,
        cab_category_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cab_2 on 530_to_532.tctg_cab_category_attributes (
        cab_node_id,
        cab_value_numeric,
        cab_next_version_id,
        cab_version_id,
        cab_cat_tree_id,
        cab_category_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_csm_0 on 530_to_532.tctg_csm_category_spec_map (
        csm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_csm_1 on 530_to_532.tctg_csm_category_spec_map (
        csm_spec_id,
        csm_next_version_id,
        csm_version_id,
        csm_company_id,
        csm_cat_tree_id,
        csm_filter_catalog_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_csm_2 on 530_to_532.tctg_csm_category_spec_map (
        csm_filter_catalog_id,
        csm_next_version_id,
        csm_version_id,
        csm_company_id,
        csm_spec_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_csm_3 on 530_to_532.tctg_csm_category_spec_map (
        csm_cat_tree_id,
        csm_next_version_id,
        csm_version_id,
        csm_filter_catalog_id,
        csm_company_id,
        csm_spec_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_csm_4 on 530_to_532.tctg_csm_category_spec_map (
        csm_category_id,
        csm_next_version_id,
        csm_version_id,
        csm_filter_catalog_id,
        csm_company_id,
        csm_spec_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_csm_5 on 530_to_532.tctg_csm_category_spec_map (
        csm_category_id,
        csm_version_id,
        csm_next_version_id,
        csm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_csa_0 on 530_to_532.tctg_csa_cat_sys_attr (
        csa_category_id,
        csa_next_version_id,
        csa_version_id,
        csa_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_csa_1 on 530_to_532.tctg_csa_cat_sys_attr (
        csa_name,
        csa_value,
        csa_next_version_id,
        csa_version_id,
        csa_cat_tree_id,
        csa_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_csa_2 on 530_to_532.tctg_csa_cat_sys_attr (
        csa_cat_tree_id,
        csa_name,
        csa_next_version_id,
        csa_version_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cfp_0 on 530_to_532.tctg_cfp_cat_full_paths (
        cfp_category_id,
        cfp_next_version_id,
        cfp_version_id,
        cfp_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cfp_1 on 530_to_532.tctg_cfp_cat_full_paths (
        cfp_full_path_type,
        cfp_full_path,
        cfp_next_version_id,
        cfp_version_id,
        cfp_cat_tree_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cfp_2 on 530_to_532.tctg_cfp_cat_full_paths (
        cfp_cat_tree_id,
        cfp_full_path_type,
        cfp_next_version_id,
        cfp_version_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_chi_0 on 530_to_532.tctg_chi_category_hierarchy (
        chi_child_id,
        chi_next_version_id,
        chi_version_id,
        chi_company_id,
        chi_cat_tree_id,
        chi_parent_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_chi_1 on 530_to_532.tctg_chi_category_hierarchy (
        chi_parent_id,
        chi_next_version_id,
        chi_version_id,
        chi_company_id,
        chi_cat_tree_id,
        chi_child_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ccm_0 on 530_to_532.tctg_ccm_category_category_map (
        ccm_src_cat_tree_id,
        ccm_dst_cat_tree_id,
        ccm_next_version_id,
        ccm_version_id,
        ccm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ccm_1 on 530_to_532.tctg_ccm_category_category_map (
        ccm_dst_cat_tree_id,
        ccm_src_cat_tree_id,
        ccm_next_version_id,
        ccm_version_id,
        ccm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_icm_0 on 530_to_532.tctg_icm_item_category_map (
        icm_item_id,
        icm_category_id,
        icm_next_version_id,
        icm_version_id,
        icm_cat_tree_id,
        icm_catalog_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_icm_1 on 530_to_532.tctg_icm_item_category_map (
        icm_category_id,
        icm_next_version_id,
        icm_version_id,
        icm_cat_tree_id,
        icm_catalog_id,
        icm_item_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_icm_2 on 530_to_532.tctg_icm_item_category_map (
        icm_catalog_id,
        icm_next_version_id,
        icm_version_id,
        icm_cat_tree_id,
        icm_category_id,
        icm_item_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_icm_3 on 530_to_532.tctg_icm_item_category_map (
        icm_item_id,
        icm_version_id,
        icm_next_version_id,
        icm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_spc_0 on 530_to_532.tctg_spc_specification (
        spc_id,
        spc_company_id,
        spc_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_spc_1 on 530_to_532.tctg_spc_specification (
        spc_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_spc_2 on 530_to_532.tctg_spc_specification (
        spc_name,
        spc_company_id,
        spc_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_spa_0 on 530_to_532.tctg_spa_spec_attributes (
        spa_spec_id,
        spa_next_version_id,
        spa_version_id,
        spa_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_spa_1 on 530_to_532.tctg_spa_spec_attributes (
        spa_spec_id,
        spa_name,
        spa_value,
        spa_next_version_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_spa_2 on 530_to_532.tctg_spa_spec_attributes (
        spa_name,
        spa_value,
        spa_next_version_id,
        spa_company_id,
        spa_spec_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_nod_0 on 530_to_532.tctg_nod_node (
        nod_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_nod_1 on 530_to_532.tctg_nod_node (
        nod_spec_id,
        nod_next_version_id,
        nod_version_id,
        nod_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_nod_2 on 530_to_532.tctg_nod_node (
        nod_name,
        nod_spec_id,
        nod_next_version_id,
        nod_version_id,
        nod_company_id,
        nod_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_nod_3 on 530_to_532.tctg_nod_node (
        nod_id,
        nod_next_version_id,
        nod_version_id,
        nod_spec_id,
        nod_type,
        nod_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_noa_0 on 530_to_532.tctg_noa_node_attributes (
        noa_node_id,
        noa_next_version_id,
        noa_version_id,
        noa_company_id,
        noa_spec_id,
        noa_order
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_noa_1 on 530_to_532.tctg_noa_node_attributes (
        noa_spec_id,
        noa_node_id,
        noa_next_version_id,
        noa_version_id,
        noa_name,
        noa_order
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_noa_2 on 530_to_532.tctg_noa_node_attributes (
        noa_name,
        noa_next_version_id,
        noa_version_id,
        noa_company_id,
        noa_value
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_noa_3 on 530_to_532.tctg_noa_node_attributes (
        noa_node_id,
        noa_next_version_id,
        noa_name,
        noa_value
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_noa_4 on 530_to_532.tctg_noa_node_attributes (
        noa_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_noh_0 on 530_to_532.tctg_noh_node_hierarchy (
        noh_spec_id,
        noh_next_version_id,
        noh_version_id,
        noh_company_id,
        noh_child_node_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_noh_1 on 530_to_532.tctg_noh_node_hierarchy (
        noh_child_node_id,
        noh_next_version_id,
        noh_version_id,
        noh_spec_id,
        noh_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_noh_2 on 530_to_532.tctg_noh_node_hierarchy (
        noh_parent_node_id,
        noh_next_version_id,
        noh_version_id,
        noh_spec_id,
        noh_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_noh_3 on 530_to_532.tctg_noh_node_hierarchy (
        noh_child_node_id,
        noh_parent_node_id,
        noh_next_version_id,
        noh_version_id,
        noh_spec_id,
        noh_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_nom_0 on 530_to_532.tctg_nom_node_mapping (
        nom_sub_spec_id,
        nom_sub_spec_node_id,
        nom_master_spec_id,
        nom_master_spec_node_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_obm_0 on 530_to_532.tctg_obm_object_map (
        obm_id,
        obm_type,
        obm_version_id,
        obm_next_version_id,
        obm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_obm_1 on 530_to_532.tctg_obm_object_map (
        obm_name,
        obm_type,
        obm_version_id,
        obm_next_version_id,
        obm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_obm_2 on 530_to_532.tctg_obm_object_map (
        obm_type,
        obm_src_object_id,
        obm_dst_object_id,
        obm_version_id,
        obm_next_version_id,
        obm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_omd_0 on 530_to_532.tctg_omd_object_map_detail (
        omd_object_map_id,
        omd_next_version_id,
        omd_version_id,
        omd_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_oms_0 on 530_to_532.tctg_oms_object_map_scripts (
        oms_object_map_id,
        oms_next_version_id,
        oms_version_id,
        oms_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ctm_0 on 530_to_532.tctg_ctm_categorization_map (
        ctm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ctm_1 on 530_to_532.tctg_ctm_categorization_map (
        ctm_categmap_id,
        ctm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cmd_0 on 530_to_532.tctg_cmd_categmap_detail (
        cmd_categmap_id,
        cmd_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cmd_1 on 530_to_532.tctg_cmd_categmap_detail (
        cmd_detail_id,
        cmd_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cmc_0 on 530_to_532.tctg_cmc_categmap_categories (
        cmc_detail_id,
        cmc_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cmc_1 on 530_to_532.tctg_cmc_categmap_categories (
        cmc_category_id,
        cmc_detail_id,
        cmc_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cgm_0 on 530_to_532.tctg_cgm_catalog_catalog_map (
        cgm_src_ctg_id,
        cgm_src_node_id,
        cgm_next_version_id,
        cgm_version_id,
        cgm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_cgm_1 on 530_to_532.tctg_cgm_catalog_catalog_map (
        cgm_dst_ctg_id,
        cgm_dst_node_id,
        cgm_next_version_id,
        cgm_version_id,
        cgm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_seq_0 on 530_to_532.tctg_seq_sequence (
        seq_name,
        seq_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_epr_0 on 530_to_532.tctg_epr_entry_processor_run (
        epr_user_id,
        epr_type,
        epr_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_epr_1 on 530_to_532.tctg_epr_entry_processor_run (
        epr_run_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_rul_0 on 530_to_532.tctg_rul_inheritance_rule (
        rul_src_ctg_id,
        rul_src_ctr_id,
        rul_next_version_id,
        rul_version_id,
        rul_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_rul_1 on 530_to_532.tctg_rul_inheritance_rule (
        rul_id,
        rul_next_version_id,
        rul_version_id,
        rul_src_ctg_id,
        rul_src_ctr_id,
        rul_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_rul_2 on 530_to_532.tctg_rul_inheritance_rule (
        rul_company_id,
        rul_next_version_id,
        rul_version_id,
        rul_collab_id,
        rul_src_ctg_id,
        rul_src_ctr_id,
        rul_name,
        rul_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_rul_3 on 530_to_532.tctg_rul_inheritance_rule (
        rul_company_id,
        rul_next_version_id,
        rul_version_id,
        rul_collab_id,
        rul_name,
        rul_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_rgm_0 on 530_to_532.tctg_rgm_rul_group_map (
        rgm_rule_id,
        rgm_next_version_id,
        rgm_version_id,
        rgm_attr_group_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_rgm_1 on 530_to_532.tctg_rgm_rul_group_map (
        rgm_attr_group_id,
        rgm_next_version_id,
        rgm_version_id,
        rgm_rule_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_udl_0 on 530_to_532.tctg_udl_user_defined_logs (
        udl_id,
        udl_container_id,
        udl_container_type
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_tmt_0 on 530_to_532.tctg_tmt_test_multi_row (
        tmt_node_id,
        tmt_next_version_id,
        tmt_version_id,
        tmt_catalog_id,
        tmt_item_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_tmt_1 on 530_to_532.tctg_tmt_test_multi_row (
        tmt_item_id,
        tmt_catalog_id,
        tmt_next_version_id,
        tmt_version_id,
        tmt_node_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_etp_0 on 530_to_532.tctg_etp_entry_tabbed_pane (
        etp_container_type,
        etp_container_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_etp_1 on 530_to_532.tctg_etp_entry_tabbed_pane (
        etp_tab_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_etp_2 on 530_to_532.tctg_etp_entry_tabbed_pane (
        etp_ctg_view_id,
        etp_ctg_sub_view_id,
        etp_tab_id,
        etp_tab_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_tpa_0 on 530_to_532.tctg_tpa_tabbed_pane_attr (
        tpa_tab_id,
        tpa_attr_group_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_tpa_1 on 530_to_532.tctg_tpa_tabbed_pane_attr (
        tpa_tab_id,
        tpa_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ord_0 on 530_to_532.tctg_ord_ordering (
        ord_id,
        ord_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ord_1 on 530_to_532.tctg_ord_ordering (
        ord_catalog_id,
        ord_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_ord_2 on 530_to_532.tctg_ord_ordering (
        ord_cat_tree_id,
        ord_catalog_id,
        ord_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_odd_0 on 530_to_532.tctg_odd_ord_detail (
        odd_catalog_id,
        odd_next_version_id,
        odd_version_id,
        odd_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_odd_1 on 530_to_532.tctg_odd_ord_detail (
        odd_ord_id,
        odd_next_version_id,
        odd_version_id,
        odd_parent_id,
        odd_type,
        odd_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_odd_2 on 530_to_532.tctg_odd_ord_detail (
        odd_parent_id,
        odd_next_version_id,
        odd_version_id,
        odd_ord_id,
        odd_type,
        odd_company_id,
        odd_child_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_odd_3 on 530_to_532.tctg_odd_ord_detail (
        odd_cat_tree_id,
        odd_catalog_id,
        odd_next_version_id,
        odd_version_id,
        odd_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_atg_0 on 530_to_532.tctg_atg_attr_group (
        atg_id,
        atg_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_atg_1 on 530_to_532.tctg_atg_attr_group (
        atg_name,
        atg_company_id,
        atg_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_atg_2 on 530_to_532.tctg_atg_attr_group (
        atg_company_id,
        atg_type,
        atg_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_agn_0 on 530_to_532.tctg_agn_attr_group_node (
        agn_attr_group_id,
        agn_next_version_id,
        agn_version_id,
        agn_spec_id,
        agn_node_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_agn_1 on 530_to_532.tctg_agn_attr_group_node (
        agn_node_id,
        agn_next_version_id,
        agn_version_id,
        agn_attr_group_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_agn_2 on 530_to_532.tctg_agn_attr_group_node (
        agn_spec_id,
        agn_next_version_id,
        agn_version_id,
        agn_attr_group_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_agl_0 on 530_to_532.tctg_agl_attr_group_locale (
        agl_attr_group_id,
        agl_next_version_id,
        agl_version_id,
        agl_locale
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_agd_0 on 530_to_532.tctg_agd_attr_group_dyn_node (
        agd_attr_group_id,
        agd_spec_id,
        agd_node_id,
        agd_next_version_id,
        agd_version_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_sim_0 on 530_to_532.tctg_sim_status_image_map (
        sim_object_container_id,
        sim_object_type,
        sim_status,
        sim_company_id,
        sim_image_url
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_rec_0 on 530_to_532.tctg_rec_relation_container (
        rec_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_rec_1 on 530_to_532.tctg_rec_relation_container (
        rec_ctg_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_rea_0 on 530_to_532.tctg_rea_relation_attributes (
        rea_relation_id,
        rea_next_version_id,
        rea_version_id,
        rea_company_id,
        rea_name,
        rea_value
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_rea_1 on 530_to_532.tctg_rea_relation_attributes (
        rea_name,
        rea_value,
        rea_relation_id,
        rea_next_version_id,
        rea_version_id,
        rea_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ictg_esr_0 on 530_to_532.tctg_esr_entry_search_result (
        esr_entry_id,
        esr_sel_id,
        esr_ctg_id
)  ALLOW REVERSE SCANS;










create index 530_to_532.idis_dsa_0 on 530_to_532.tdis_dsa_dst_attributes (
        dsa_distribution_id,
        dsa_node_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idis_dst_0 on 530_to_532.tdis_dst_mkt_distribution (
        dst_distribution_id,
        dst_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idis_dst_1 on 530_to_532.tdis_dst_mkt_distribution (
        dst_distribution_name,
        dst_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idis_dgp_0 on 530_to_532.tdis_dgp_distribution_group (
        dgp_distribution_group_id,
        dgp_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idis_dgp_1 on 530_to_532.tdis_dgp_distribution_group (
        dgp_distribution_group_name,
        dgp_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idis_dgl_0 on 530_to_532.tdis_dgl_distribution_list (
        dgl_distribution_group_id,
        dgl_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idis_dgl_1 on 530_to_532.tdis_dgl_distribution_list (
        dgl_distribution_id,
        dgl_company_id
)  ALLOW REVERSE SCANS;









create index 530_to_532.idoc_dbl_0 on 530_to_532.tdoc_dbl_doc_blob (
        dbl_doc_id,
        dbl_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idoc_dhi_0 on 530_to_532.tdoc_dhi_doc_hierarchy (
        dhi_doc_id,
        dhi_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idoc_dhi_1 on 530_to_532.tdoc_dhi_doc_hierarchy (
        dhi_doc_real_path,
        dhi_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idoc_dhi_2 on 530_to_532.tdoc_dhi_doc_hierarchy (
        dhi_doc_path,
        dhi_cmp_id,
        dhi_doc_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idoc_doa_0 on 530_to_532.tdoc_doa_doc_attributes (
        doa_name,
        doa_doc_id,
        doa_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.idoc_dad_0 on 530_to_532.tdoc_dad_docstore_audit (
        dad_doc_path,
        dad_cmp_id
)  ALLOW REVERSE SCANS;










create index 530_to_532.ievt_que_0 on 530_to_532.tevt_que_queue (
        que_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ievt_ald_0 on 530_to_532.tevt_ald_alert_description (
        ald_arl_desc_id,
        ald_user_id,
        ald_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ievt_ald_1 on 530_to_532.tevt_ald_alert_description (
        ald_event_name,
        ald_enabled,
        ald_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ievt_ads_0 on 530_to_532.tevt_ads_alert_subscription (
        ads_arl_desc_id,
        ads_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ievt_act_0 on 530_to_532.tevt_act_actionables (
        act_user_role_id,
        act_recipient_type,
        act_cmp_id,
        act_desc_sub_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ievt_act_1 on 530_to_532.tevt_act_actionables (
        act_event_name,
        act_user_role_id,
        act_recipient_type,
        act_cmp_id,
        act_param_values
)  ALLOW REVERSE SCANS;



create index 530_to_532.ievt_ccp_0 on 530_to_532.tevt_ccp_calendar_cmp_pref (
        ccp_company_id,
        ccp_event_name
)  ALLOW REVERSE SCANS;










create index 530_to_532.iorg_iom_0 on 530_to_532.torg_iom_item_organization_map (
        iom_item_id,
        iom_company_id,
        iom_organization_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iorg_iom_1 on 530_to_532.torg_iom_item_organization_map (
        iom_organization_id,
        iom_company_id,
        iom_item_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iorg_com_0 on 530_to_532.torg_com_category_org_map (
        com_category_id,
        com_company_id,
        com_organization_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iorg_com_1 on 530_to_532.torg_com_category_org_map (
        com_organization_id,
        com_company_id,
        com_category_id
)  ALLOW REVERSE SCANS;









create index 530_to_532.iper_par_0 on 530_to_532.tper_par_params (
        par_instance_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iper_lft_0 on 530_to_532.tper_lft_leftnav (
        lft_company_id,
        lft_user_id
)  ALLOW REVERSE SCANS;









create index 530_to_532.ipfm_ppr_0 on 530_to_532.tpfm_ppr_profile (
        ppr_profile_id,
        ppr_name,
        ppr_depth
)  ALLOW REVERSE SCANS;



create index 530_to_532.ipfm_ppi_0 on 530_to_532.tpfm_ppi_profile_info (
        ppi_profile_name,
        ppi_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ipfm_ppi_1 on 530_to_532.tpfm_ppi_profile_info (
        ppi_start_time,
        ppi_company_id,
        ppi_profile_id,
        ppi_profile_name,
        ppi_user_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ipfm_psi_0 on 530_to_532.tpfm_psi_profile_schedule_info (
        psi_profile_id,
        psi_schedule_index
)  ALLOW REVERSE SCANS;



create index 530_to_532.ipfm_psi_1 on 530_to_532.tpfm_psi_profile_schedule_info (
        psi_schedule_index
)  ALLOW REVERSE SCANS;



create index 530_to_532.ipfm_psd_0 on 530_to_532.tpfm_psd_schedule_detail (
        psd_schedule_index
)  ALLOW REVERSE SCANS;










create index 530_to_532.ipgc_pmr_0 on 530_to_532.tpgc_pmr_params (
        pmr_instance_id
)  ALLOW REVERSE SCANS;









create index 530_to_532.ique_msd_0 on 530_to_532.tque_msd_message_definition (
        msd_type_id,
        msd_cmp_id,
        msd_message_type
)  ALLOW REVERSE SCANS;



create index 530_to_532.ique_msd_1 on 530_to_532.tque_msd_message_definition (
        msd_message_type,
        msd_cmp_id,
        msd_type_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ique_mtd_0 on 530_to_532.tque_mtd_queue_msg_type_detail (
        mtd_type_id,
        mtd_attr_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.ique_qmm_0 on 530_to_532.tque_qmm_queue_message_map (
        qmm_queue_id,
        qmm_msg_type_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ique_qmm_1 on 530_to_532.tque_qmm_queue_message_map (
        qmm_msg_type_id,
        qmm_queue_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ique_qtm_0 on 530_to_532.tque_qtm_que_type_message_map (
        qtm_queue_type,
        qtm_msg_type_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.ique_qtm_1 on 530_to_532.tque_qtm_que_type_message_map (
        qtm_msg_type_id,
        qtm_queue_type
)  ALLOW REVERSE SCANS;




create index 530_to_532.irss_rsa_0 on 530_to_532.trss_rsa_search_attr_group (
        rsa_company_id,
        rsa_id,
        rsa_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.irss_rsa_1 on 530_to_532.trss_rsa_search_attr_group (
        rsa_company_id,
        rsa_container_id,
        rsa_step_id
)  ALLOW REVERSE SCANS;









create index 530_to_532.isch_scj_0 on 530_to_532.tsch_scj_job (
        scj_job_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isch_scj_1 on 530_to_532.tsch_scj_job (
        scj_user_id,
        scj_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isch_scp_0 on 530_to_532.tsch_scp_params (
        scp_job_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isch_ssp_0 on 530_to_532.tsch_ssp_schedule_params (
        ssp_schedule_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isch_sch_0 on 530_to_532.tsch_sch_schedule (
        sch_job_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isch_sch_1 on 530_to_532.tsch_sch_schedule (
        sch_next_running_time,
        sch_enabled
)  ALLOW REVERSE SCANS;



create index 530_to_532.isch_scc_0 on 530_to_532.tsch_scc_completedschedules (
        scc_schedule_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isch_scc_1 on 530_to_532.tsch_scc_completedschedules (
        scc_schedule_index
)  ALLOW REVERSE SCANS;



create index 530_to_532.isch_scc_2 on 530_to_532.tsch_scc_completedschedules (
        scc_start_time,
        scc_completion_time,
        scc_user_id,
        scc_company_id
)  ALLOW REVERSE SCANS;










create index 530_to_532.isec_oac_0 on 530_to_532.tsec_oac_object_action (
        oac_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_rol_0 on 530_to_532.tsec_rol_role (
        rol_role_id,
        rol_role_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_rol_1 on 530_to_532.tsec_rol_role (
        rol_company_id,
        rol_role_id,
        rol_role_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_urm_0 on 530_to_532.tsec_urm_user_role_map (
        urm_user_id,
        urm_role_id,
        urm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_urm_1 on 530_to_532.tsec_urm_user_role_map (
        urm_role_id,
        urm_user_id,
        urm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_obt_0 on 530_to_532.tsec_obt_object_type (
        obt_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_cap_0 on 530_to_532.tsec_cap_ctg_access_prv (
        cap_company_id,
        cap_cap_id,
        cap_attr_group_id,
        cap_viewable
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_cap_1 on 530_to_532.tsec_cap_ctg_access_prv (
        cap_cap_id,
        cap_attr_group_id,
        cap_viewable
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_cma_0 on 530_to_532.tsec_cma_cap_role_object_map (
        cma_cap_id,
        cma_role_id,
        cma_object_id,
        cma_object_type
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_cvd_0 on 530_to_532.tsec_cvd_ctg_view_detail (
        cvd_view_id,
        cvd_sub_view_type,
        cvd_sub_view_id,
        cvd_attr_group_id,
        cvd_viewable
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_cvd_1 on 530_to_532.tsec_cvd_ctg_view_detail (
        cvd_attr_group_id,
        cvd_view_id,
        cvd_sub_view_type,
        cvd_sub_view_id,
        cvd_viewable,
        cvd_order
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_cvi_0 on 530_to_532.tsec_cvi_ctg_view (
        cvi_view_id,
        cvi_object_id,
        cvi_object_type,
        cvi_view_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_obg_0 on 530_to_532.tsec_obg_object_group (
        obg_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_ogm_0 on 530_to_532.tsec_ogm_object_group_map (
        ogm_object_group_id,
        ogm_object_type_id,
        ogm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_orm_0 on 530_to_532.tsec_orm_object_group_role_map (
        orm_object_group_id,
        orm_role_id,
        orm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_orm_1 on 530_to_532.tsec_orm_object_group_role_map (
        orm_role_id,
        orm_object_group_id,
        orm_company_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.isec_rsm_0 on 530_to_532.tsec_rsm_role_to_script_map (
        rsm_role_id,
        rsm_script_name,
        rsm_company_id
)  ALLOW REVERSE SCANS;










create index 530_to_532.isyn_agr_0 on 530_to_532.tsyn_agr_attr_group (
        agr_attr_group_id,
        agr_cmp_id,
        agr_attr_group_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.isyn_agr_1 on 530_to_532.tsyn_agr_attr_group (
        agr_attr_group_name,
        agr_cmp_id,
        agr_attr_group_id
)  ALLOW REVERSE SCANS;










create index 530_to_532.iutl_lck_0 on 530_to_532.tutl_lck_lock (
        lck_jvm_id,
        lck_thread_id,
        lck_type
)  ALLOW REVERSE SCANS;




create index 530_to_532.iutl_jhb_0 on 530_to_532.tutl_jhb_jvm_heartbeat (
        jhb_jvm_id
)  ALLOW REVERSE SCANS;









create index 530_to_532.iwfl_std_0 on 530_to_532.twfl_std_step_def (
        std_id,
        std_type
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_std_1 on 530_to_532.twfl_std_step_def (
        std_wfl_id,
        std_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_stg_0 on 530_to_532.twfl_stg_step_attr_group (
        stg_step_id,
        stg_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_wfd_0 on 530_to_532.twfl_wfd_workflow_def (
        wfd_id,
        wfd_name,
        wfd_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_wfg_0 on 530_to_532.twfl_wfg_workflow_graph (
        wfg_wfl_id,
        wfg_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_wfg_1 on 530_to_532.twfl_wfg_workflow_graph (
        wfg_src_step_id,
        wfg_exit_value,
        wfg_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_wfg_2 on 530_to_532.twfl_wfg_workflow_graph (
        wfg_dst_step_id,
        wfg_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_spt_0 on 530_to_532.twfl_spt_step_path (
        spt_id,
        spt_leaf_step_id,
        spt_leaf_step_path
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_spt_1 on 530_to_532.twfl_spt_step_path (
        spt_leaf_step_path
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_spt_2 on 530_to_532.twfl_spt_step_path (
        spt_leaf_wfl_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_spt_3 on 530_to_532.twfl_spt_step_path (
        spt_root_wfl_id,
        spt_leaf_step_text_path
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_spt_4 on 530_to_532.twfl_spt_step_path (
        spt_id,
        spt_root_wfl_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_coa_0 on 530_to_532.twfl_coa_collaboration_area (
        coa_name,
        coa_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_coa_1 on 530_to_532.twfl_coa_collaboration_area (
        coa_container_type,
        coa_src_container_id,
        coa_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_coa_2 on 530_to_532.twfl_coa_collaboration_area (
        coa_container_type,
        coa_dst_container_id,
        coa_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_coa_3 on 530_to_532.twfl_coa_collaboration_area (
        coa_id,
        coa_wfl_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_cae_0 on 530_to_532.twfl_cae_coll_area_entry (
        cae_ca_id,
        cae_step_path_id,
        cae_entry_id,
        cae_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_csj_0 on 530_to_532.twfl_csj_coll_area_step_job (
        csj_cmp_id,
        csj_schedule_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_cem_0 on 530_to_532.twfl_cem_coll_entry_mapping (
        cem_ca_id,
        cem_ca_entry_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_ceh_0 on 530_to_532.twfl_ceh_coll_entry_history (
        ceh_entry_key,
        ceh_ca_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_ceh_1 on 530_to_532.twfl_ceh_coll_entry_history (
        ceh_date,
        ceh_ca_name
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_cel_0 on 530_to_532.twfl_cel_coll_entry_lock (
        cel_container_id,
        cel_container_type,
        cel_user_id,
        cel_cmp_id
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_wfe_0 on 530_to_532.twfl_wfe_workflow_event (
        wfe_id,
        wfe_event_status,
        wfe_event_type
)  ALLOW REVERSE SCANS;



create index 530_to_532.iwfl_wee_0 on 530_to_532.twfl_wee_workflow_event_entry (
        wee_event_id,
        wee_entry_id,
        wee_event_entry_status
)  ALLOW REVERSE SCANS;








