-- C:\Andy\svn\WEBMIP\Schema\mip.ind
--
-- Generated for Oracle 10g on Fri Mar 14  12:19:24 2008 by Server Generator 10.1.2.6.18
  

PROMPT Creating Index 'REGU_RETY_FK_I'
CREATE INDEX REGU_RETY_FK_I ON REGULATORS
 (RETY_CODE)
/

PROMPT Creating Index 'PAR_PADDR_FK_I'
CREATE INDEX PAR_PADDR_FK_I ON PARTY_ADDRESS_ROLES
 (PADDR_START_DATE
 ,PADDR_ADDR_CODE
 ,PADDR_PRTY_ID)
/

PROMPT Creating Index 'PAR_RT_FK_I'
CREATE INDEX PAR_RT_FK_I ON PARTY_ADDRESS_ROLES
 (RT_CODE)
/

PROMPT Creating Index 'QURE_ENQU_FK_I'
CREATE INDEX QURE_ENQU_FK_I ON QUOTE_REASONING
 (ENQU_ID)
/

PROMPT Creating Index 'DIR_ENTY_FK_I'
CREATE INDEX DIR_ENTY_FK_I ON DATA_ITEM_ROLES
 (ENTY_CODE)
/

PROMPT Creating Index 'COME_COMT_FK_I'
CREATE INDEX COME_COMT_FK_I ON CONTACT_MECHANISMS
 (COMT_CODE)
/

PROMPT Creating Index 'PCM_COME_FK_I'
CREATE INDEX PCM_COME_FK_I ON PARTY_CONTACT_MECHANISMS
 (COME_ID)
/

PROMPT Creating Index 'PCM_PRTY_FK_I'
CREATE INDEX PCM_PRTY_FK_I ON PARTY_CONTACT_MECHANISMS
 (PRTY_ID)
/

PROMPT Creating Index 'PCM_PADDR_FK_I'
CREATE INDEX PCM_PADDR_FK_I ON PARTY_CONTACT_MECHANISMS
 (PADDR_START_DATE
 ,PADDR_ADDR_CODE
 ,PADDR_PRTY_ID)
/

PROMPT Creating Index 'CATE_ENTY_FK_I'
CREATE INDEX CATE_ENTY_FK_I ON CAVEAT_TEXTS
 (ENTY_CODE)
/

PROMPT Creating Index 'CATE_METY_FK_I'
CREATE INDEX CATE_METY_FK_I ON CAVEAT_TEXTS
 (METY_CODE)
/

PROMPT Creating Index 'CATE_SVCPT_FK_I'
CREATE INDEX CATE_SVCPT_FK_I ON CAVEAT_TEXTS
 (SVCPT_CODE)
/

PROMPT Creating Index 'COST_METY_FK_I'
CREATE INDEX COST_METY_FK_I ON COSTS
 (METY_CODE)
/

PROMPT Creating Index 'COST_SVCPT_FK_I'
CREATE INDEX COST_SVCPT_FK_I ON COSTS
 (SVCPT_CODE)
/

PROMPT Creating Index 'COST_ADIT_FK_I'
CREATE INDEX COST_ADIT_FK_I ON COSTS
 (ADIT_CODE)
/

PROMPT Creating Index 'COST_UK'
CREATE UNIQUE INDEX COST_UK ON COSTS
 (VALID_FROM, REGI_CODE, COST_TYPE, CASE COST_TYPE WHEN 'MOCO' THEN MODU_CODE WHEN 'BACO' THEN BAS_CODE WHEN 'HOCO' THEN HOU_CODE WHEN 'MECO' THEN METR_CODE WHEN 'AICO' THEN ADIT_CODE WHEN 'LACO' THEN ENTY_CODE END, CASE COST_TYPE WHEN 'LACO' THEN SVCPT_CODE ELSE NULL END, CASE COST_TYPE WHEN 'LACO' THEN MESC_CODE ELSE NULL END, CASE COST_TYPE WHEN 'LACO' THEN METY_CODE ELSE NULL END)
/

PROMPT Creating Index 'COST_MESC_FK_I'
CREATE INDEX COST_MESC_FK_I ON COSTS
 (MESC_CODE)
/

PROMPT Creating Index 'COST_ENTY_FK_I'
CREATE INDEX COST_ENTY_FK_I ON COSTS
 (ENTY_CODE)
/

PROMPT Creating Index 'COST_BAS_FK_I'
CREATE INDEX COST_BAS_FK_I ON COSTS
 (BAS_CODE)
/

PROMPT Creating Index 'COST_REGI_FK_I'
CREATE INDEX COST_REGI_FK_I ON COSTS
 (REGI_CODE)
/

PROMPT Creating Index 'COST_MODU_FK_I'
CREATE INDEX COST_MODU_FK_I ON COSTS
 (MODU_CODE)
/

PROMPT Creating Index 'COST_METR_FK_I'
CREATE INDEX COST_METR_FK_I ON COSTS
 (METR_CODE)
/

PROMPT Creating Index 'COST_HOU_FK_I'
CREATE INDEX COST_HOU_FK_I ON COSTS
 (HOU_CODE)
/

PROMPT Creating Index 'DOEV_DOCU_FK_I'
CREATE INDEX DOEV_DOCU_FK_I ON DOCUMENT_EVENTS
 (DOCU_ID)
/

PROMPT Creating Index 'DOEV_DOST_FK_I'
CREATE INDEX DOEV_DOST_FK_I ON DOCUMENT_EVENTS
 (DOST_CODE)
/

PROMPT Creating Index 'FLTR_FITY_FK_I'
CREATE INDEX FLTR_FITY_FK_I ON FILTERS
 (FITY_CODE)
/

PROMPT Creating Index 'PCMR_PCM_FK_I'
CREATE INDEX PCMR_PCM_FK_I ON PARTY_CONTACT_MECHANISM_ROLES
 (PCM_START_DATE
 ,PCM_COME_ID
 ,PCM_PRTY_ID)
/

PROMPT Creating Index 'PCMR_RT_FK_I'
CREATE INDEX PCMR_RT_FK_I ON PARTY_CONTACT_MECHANISM_ROLES
 (RT_CODE)
/

PROMPT Creating Index 'QURO_PRTY_FK_I'
CREATE INDEX QURO_PRTY_FK_I ON QUOTE_ROLES
 (PRTY_ID)
/

PROMPT Creating Index 'QURO_QUTE_FK_I'
CREATE INDEX QURO_QUTE_FK_I ON QUOTE_ROLES
 (QUTE_ID)
/

PROMPT Creating Index 'QURO_RT_FK_I'
CREATE INDEX QURO_RT_FK_I ON QUOTE_ROLES
 (RT_CODE)
/

PROMPT Creating Index 'QUTE_ENQU_FK_I'
CREATE INDEX QUTE_ENQU_FK_I ON QUOTES
 (ENQU_ID)
/

PROMPT Creating Index 'PREL_PRTP_FK_I'
CREATE INDEX PREL_PRTP_FK_I ON PARTY_RELATIONSHIPS
 (TO_PRTP_RT_CODE
 ,FROM_PRTP_RT_CODE)
/

PROMPT Creating Index 'PREL_PARL_FK_I'
CREATE INDEX PREL_PARL_FK_I ON PARTY_RELATIONSHIPS
 (FROM_PARL_ID
 ,FROM_PARL_PRTY_ID
 ,FROM_PARL_RT_CODE)
/

PROMPT Creating Index 'PREL_PARL_TO_FK_I'
CREATE INDEX PREL_PARL_TO_FK_I ON PARTY_RELATIONSHIPS
 (TO_PARL_ID
 ,TO_PARL_PRTY_ID
 ,TO_PARL_RT_CODE)
/

PROMPT Creating Index 'QUEV_QUST_FK_I'
CREATE INDEX QUEV_QUST_FK_I ON QUOTE_EVENTS
 (QUST_CODE)
/

PROMPT Creating Index 'QUEV_QUTE_FK_I'
CREATE INDEX QUEV_QUTE_FK_I ON QUOTE_EVENTS
 (QUTE_ID)
/

PROMPT Creating Index 'PADDR_ADDR_FK_I'
CREATE INDEX PADDR_ADDR_FK_I ON PARTY_ADDRESSES
 (ADDR_CODE)
/

PROMPT Creating Index 'PADDR_PRTY_FK_I'
CREATE INDEX PADDR_PRTY_FK_I ON PARTY_ADDRESSES
 (PRTY_ID)
/

PROMPT Creating Index 'SVCP_SVCPT_FK_I'
CREATE INDEX SVCP_SVCPT_FK_I ON SERVICE_PRESSURES
 (SVCPT_CODE)
/

PROMPT Creating Index 'ENEV_ENST_FK_I'
CREATE INDEX ENEV_ENST_FK_I ON ENQUIRY_EVENTS
 (ENST_CODE)
/

PROMPT Creating Index 'ENEV_ENQU_FK_I'
CREATE INDEX ENEV_ENQU_FK_I ON ENQUIRY_EVENTS
 (ENQU_ID)
/

PROMPT Creating Index 'VARE_ENQU_FIELD_I'
CREATE INDEX VARE_ENQU_FIELD_I ON VALIDATION_RESULTS
 (ENQU_ID
 ,FIELD_NAME)
 INITRANS 2
 MAXTRANS 255
 PCTFREE 10
 STORAGE
 (
   INITIAL 65536
   MINEXTENTS 1
   MAXEXTENTS UNLIMITED
 )
/

PROMPT Creating Index 'POCO_POSTCODE_I'
CREATE INDEX POCO_POSTCODE_I ON POSTCODES
 (outcode||' '||incode)
/

PROMPT Creating Index 'POCO_REGI_FK_I'
CREATE INDEX POCO_REGI_FK_I ON POSTCODES
 (REGI_CODE)
/

PROMPT Creating Index 'DORO_RT_FK_I'
CREATE INDEX DORO_RT_FK_I ON DOCUMENT_ROLES
 (RT_CODE)
/

PROMPT Creating Index 'DORO_QUTE_FK_I'
CREATE INDEX DORO_QUTE_FK_I ON DOCUMENT_ROLES
 (QUTE_ID)
/

PROMPT Creating Index 'DORO_DRWG_FK_I'
CREATE INDEX DORO_DRWG_FK_I ON DOCUMENT_ROLES
 (DRWG_CODE)
/

PROMPT Creating Index 'DORO_DOCU_FK_I'
CREATE INDEX DORO_DOCU_FK_I ON DOCUMENT_ROLES
 (DOCU_ID)
/

PROMPT Creating Index 'DORO_ENQU_FK_I'
CREATE INDEX DORO_ENQU_FK_I ON DOCUMENT_ROLES
 (ENQU_ID)
/

PROMPT Creating Index 'QUIT_QUTE_FK_I'
CREATE INDEX QUIT_QUTE_FK_I ON QUOTE_ITEMS
 (QUTE_ID)
/

PROMPT Creating Index 'QUIT_SVCPT_FK_I'
CREATE INDEX QUIT_SVCPT_FK_I ON QUOTE_ITEMS
 (SVCPT_CODE)
/

PROMPT Creating Index 'QUIT_MODU_FK_I'
CREATE INDEX QUIT_MODU_FK_I ON QUOTE_ITEMS
 (MODU_CODE)
/

PROMPT Creating Index 'QUIT_METY_FK_I'
CREATE INDEX QUIT_METY_FK_I ON QUOTE_ITEMS
 (METY_CODE)
/

PROMPT Creating Index 'QUIT_BAS_FK_I'
CREATE INDEX QUIT_BAS_FK_I ON QUOTE_ITEMS
 (BAS_CODE)
/

PROMPT Creating Index 'QUIT_MESC_FK_I'
CREATE INDEX QUIT_MESC_FK_I ON QUOTE_ITEMS
 (MESC_CODE)
/

PROMPT Creating Index 'QUIT_ADIT_FK_I'
CREATE INDEX QUIT_ADIT_FK_I ON QUOTE_ITEMS
 (ADIT_CODE)
/

PROMPT Creating Index 'QUIT_ENTY_FK_I'
CREATE INDEX QUIT_ENTY_FK_I ON QUOTE_ITEMS
 (ENTY_CODE)
/

PROMPT Creating Index 'QUIT_HOU_FK_I'
CREATE INDEX QUIT_HOU_FK_I ON QUOTE_ITEMS
 (HOU_CODE)
/

PROMPT Creating Index 'PWD_PRTY_FK_I'
CREATE INDEX PWD_PRTY_FK_I ON PASSWORDS
 (PRTY_ID)
/

PROMPT Creating Index 'LETI_ENTY_FK_I'
CREATE INDEX LETI_ENTY_FK_I ON LEAD_TIMES
 (ENTY_CODE)
/

PROMPT Creating Index 'LETI_MESC_FK_I'
CREATE INDEX LETI_MESC_FK_I ON LEAD_TIMES
 (MESC_CODE)
/

PROMPT Creating Index 'LETI_METY_FK_I'
CREATE INDEX LETI_METY_FK_I ON LEAD_TIMES
 (METY_CODE)
/

PROMPT Creating Index 'LETI_SVCPT_FK_I'
CREATE INDEX LETI_SVCPT_FK_I ON LEAD_TIMES
 (SVCPT_CODE)
/

PROMPT Creating Index 'METR_MESC_FK_I'
CREATE INDEX METR_MESC_FK_I ON METERS
 (MESC_CODE)
/

PROMPT Creating Index 'METR_METY_FK_I'
CREATE INDEX METR_METY_FK_I ON METERS
 (METY_CODE)
/

PROMPT Creating Index 'METR_DRWG_FK_I'
CREATE INDEX METR_DRWG_FK_I ON METERS
 (DRWG_CODE)
/

PROMPT Creating Index 'METR_PRTY_FK_I'
CREATE INDEX METR_PRTY_FK_I ON METERS
 (PRTY_ID)
/

PROMPT Creating Index 'SLVA_SLTY_FK_I'
CREATE INDEX SLVA_SLTY_FK_I ON SLAMSHUT_VALVES
 (SLTY_CODE)
/

PROMPT Creating Index 'ENRO_RT_FK_I'
CREATE INDEX ENRO_RT_FK_I ON ENQUIRY_ROLES
 (RT_CODE)
/

PROMPT Creating Index 'ENRO_PRTY_FK_I'
CREATE INDEX ENRO_PRTY_FK_I ON ENQUIRY_ROLES
 (PRTY_ID)
/

PROMPT Creating Index 'ENRO_ENQU_FK_I'
CREATE INDEX ENRO_ENQU_FK_I ON ENQUIRY_ROLES
 (ENQU_ID)
/

PROMPT Creating Index 'ENQU_METY_FK_I'
CREATE INDEX ENQU_METY_FK_I ON ENQUIRIES
 (EXISTING_METY_CODE)
/

PROMPT Creating Index 'ENQU_MESC_FK_I'
CREATE INDEX ENQU_MESC_FK_I ON ENQUIRIES
 (REQUIRED_MESC_CODE)
/

PROMPT Creating Index 'ENQU_MESC_EXISTING_FK_I'
CREATE INDEX ENQU_MESC_EXISTING_FK_I ON ENQUIRIES
 (EXISTING_MESC_CODE)
/

PROMPT Creating Index 'ENQU_METR_FK_I'
CREATE INDEX ENQU_METR_FK_I ON ENQUIRIES
 (EXISTING_METR_CODE)
/

PROMPT Creating Index 'ENQU_ENTY_FK_I'
CREATE INDEX ENQU_ENTY_FK_I ON ENQUIRIES
 (ENTY_CODE)
/

PROMPT Creating Index 'ENQU_CACA_FK_I'
CREATE INDEX ENQU_CACA_FK_I ON ENQUIRIES
 (CACA_CODE)
/

PROMPT Creating Index 'ENQU_ALTY_FK_I'
CREATE INDEX ENQU_ALTY_FK_I ON ENQUIRIES
 (ALTY_CODE)
/

PROMPT Creating Index 'ENQU_COMT_AGENT_FK_I'
CREATE INDEX ENQU_COMT_AGENT_FK_I ON ENQUIRIES
 (AGENT_COMT_CODE)
/

PROMPT Creating Index 'ENQU_PRTY_FK_I'
CREATE INDEX ENQU_PRTY_FK_I ON ENQUIRIES
 (EXISTING_PRTY_ID)
/

PROMPT Creating Index 'ENQU_SVCP_REQUIRED_FK_I'
CREATE INDEX ENQU_SVCP_REQUIRED_FK_I ON ENQUIRIES
 (REQUIRED_SVCP_CODE)
/

PROMPT Creating Index 'REVA_RVTY_FK_I'
CREATE INDEX REVA_RVTY_FK_I ON RELIEF_VALVES
 (RVTY_CODE)
/

PROMPT Creating Index 'PRTP_RT_TO_FK_I'
CREATE INDEX PRTP_RT_TO_FK_I ON PARTY_RELATIONSHIP_TYPES
 (TO_RT_CODE)
/

PROMPT Creating Index 'PRTP_RT_FROM_FK_I'
CREATE INDEX PRTP_RT_FROM_FK_I ON PARTY_RELATIONSHIP_TYPES
 (FROM_RT_CODE)
/

PROMPT Creating Index 'BAS_DRWG_FK_I'
CREATE INDEX BAS_DRWG_FK_I ON BASES
 (DRWG_CODE)
/

PROMPT Creating Index 'AUTH_RT_FK_I'
CREATE INDEX AUTH_RT_FK_I ON APEX_AUTHORIZATION
 (RT_CODE)
/

PROMPT Creating Index 'MODU_CNOR_OUTLET_FK_I'
CREATE INDEX MODU_CNOR_OUTLET_FK_I ON MODULES
 (OUTLET_CNOR_CODE)
/

PROMPT Creating Index 'MODU_PRTY_FK_I'
CREATE INDEX MODU_PRTY_FK_I ON MODULES
 (PRTY_ID)
/

PROMPT Creating Index 'MODU_METR_FK_I'
CREATE INDEX MODU_METR_FK_I ON MODULES
 (METR_CODE)
/

PROMPT Creating Index 'MODU_BAS_FK_I'
CREATE INDEX MODU_BAS_FK_I ON MODULES
 (BAS_CODE)
/

PROMPT Creating Index 'MODU_SVCP_FK_I'
CREATE INDEX MODU_SVCP_FK_I ON MODULES
 (SVCP_CODE)
/

PROMPT Creating Index 'MODU_CNTY_OUTLET_FK_I'
CREATE INDEX MODU_CNTY_OUTLET_FK_I ON MODULES
 (OUTLET_CNTY_CODE)
/

PROMPT Creating Index 'MODU_CNTY_INLET_FK_I'
CREATE INDEX MODU_CNTY_INLET_FK_I ON MODULES
 (INLET_CNTY_CODE)
/

PROMPT Creating Index 'MODU_DRWG_FK_I'
CREATE INDEX MODU_DRWG_FK_I ON MODULES
 (DRWG_CODE)
/

PROMPT Creating Index 'MODU_SLVA_FK_I'
CREATE INDEX MODU_SLVA_FK_I ON MODULES
 (SLVA_CODE)
/

PROMPT Creating Index 'MODU_REVA_FK_I'
CREATE INDEX MODU_REVA_FK_I ON MODULES
 (REVA_CODE)
/

PROMPT Creating Index 'MODU_REGU_FK_I'
CREATE INDEX MODU_REGU_FK_I ON MODULES
 (REGU_CODE)
/

PROMPT Creating Index 'MODU_CNOR_INLET_FK_I'
CREATE INDEX MODU_CNOR_INLET_FK_I ON MODULES
 (INLET_CNOR_CODE)
/

PROMPT Creating Index 'MODU_FLTR_FK_I'
CREATE INDEX MODU_FLTR_FK_I ON MODULES
 (FLTR_CODE)
/

PROMPT Creating Index 'MODU_HOU_FK_I'
CREATE INDEX MODU_HOU_FK_I ON MODULES
 (HOU_CODE)
/

PROMPT Creating Index 'HOU_DRWG_FK_I'
CREATE INDEX HOU_DRWG_FK_I ON HOUSINGS
 (DRWG_CODE)
/

PROMPT Creating Index 'HOU_HOTY_FK_I'
CREATE INDEX HOU_HOTY_FK_I ON HOUSINGS
 (HOTY_CODE)
/

PROMPT Creating Index 'HOU_PRTY_FK_I'
CREATE INDEX HOU_PRTY_FK_I ON HOUSINGS
 (PRTY_ID)
/

PROMPT Creating Index 'REEX_ENTY_FK_I'
CREATE INDEX REEX_ENTY_FK_I ON REGI_ENQU_EXCLUSIONS
 (ENTY_CODE)
/

PROMPT Creating Index 'REEX_ADIT_FK_I'
CREATE INDEX REEX_ADIT_FK_I ON REGI_ENQU_EXCLUSIONS
 (ADIT_CODE)
/

PROMPT Creating Index 'REEX_REGI_FK_I'
CREATE INDEX REEX_REGI_FK_I ON REGI_ENQU_EXCLUSIONS
 (REGI_CODE)
/

PROMPT Creating Index 'PARL_RT_FK_I'
CREATE INDEX PARL_RT_FK_I ON PARTY_ROLES
 (RT_CODE)
/

PROMPT Creating Index 'PARL_PRTY_FK_I'
CREATE INDEX PARL_PRTY_FK_I ON PARTY_ROLES
 (PRTY_ID)
/


