/**Begin D:\PDM_UPGRADE\PDM1\HAOS_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HAOS_CUSTOMOROLE' AND KSQL_INDNAME = 'IDX_HAOS_ROLEORGTEAM') CREATE INDEX IDX_HAOS_ROLEORGTEAM ON T_HAOS_CUSTOMOROLE ( FORGTEAMID );

 EXEC P_ALTERPK 'PK_HAOS_CUSTOMOROLETPL', 'T_HAOS_CUSTOMOROLETPL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HAOS_CUSTOMOROLETPL' AND KSQL_INDNAME = 'IDX_HAOS_CUSTOMOROLETPL') CREATE INDEX IDX_HAOS_CUSTOMOROLETPL ON T_HAOS_CUSTOMOROLETPL ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HAOS_CUSTOMOROLETPL' AND KSQL_INDNAME = 'IDX_HAOS_ROLETPL_STRUCTTYPE') CREATE INDEX IDX_HAOS_ROLETPL_STRUCTTYPE ON T_HAOS_CUSTOMOROLETPL ( FSTRUCTTYPEID );


 EXEC P_ALTERPK 'PK_HAOS_CUSTOMOROLETPL_L', 'T_HAOS_CUSTOMOROLETPL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HAOS_CUSTOMOROLETPL_L' AND KSQL_INDNAME = 'IDX_HAOS_CUSTOMOROLETPL_L') CREATE INDEX IDX_HAOS_CUSTOMOROLETPL_L ON T_HAOS_CUSTOMOROLETPL_L ( FID ,FLOCALEID );



/**End D:\PDM_UPGRADE\PDM1\HAOS_constraint.sql **/
