/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TPO_constraint.sql **/
 EXEC P_ALTERPK 'PK_TPO_TCNFEP_BIZDEF', 'T_TPO_TCNFEP_BIZDEF', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TPO_TCNFEP_BIZDEF_FNUM') CREATE INDEX IDX_T_TPO_TCNFEP_BIZDEF_FNUM ON T_TPO_TCNFEP_BIZDEF ( FNUMBER );


 EXEC P_ALTERPK 'PK_TPO_TCNFEP_BIZDEF_L', 'T_TPO_TCNFEP_BIZDEF_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TPO_TCNFEP_BIZDEF_L_0') CREATE INDEX IDX_TPO_TCNFEP_BIZDEF_L_0 ON T_TPO_TCNFEP_BIZDEF_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_TPO_TCNFEP_BIZDEF_TREE', 'T_TPO_TCNFEP_BIZDEF_TREE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TPO_TCNFEP_BIZDEF_T_FPA') CREATE INDEX IDX_T_TPO_TCNFEP_BIZDEF_T_FPA ON T_TPO_TCNFEP_BIZDEF_TREE ( FPARENTID );


 EXEC P_ALTERPK 'PK_TPO_TCNFEP_BIZDEF_TREE_L', 'T_TPO_TCNFEP_BIZDEF_TREE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TPO_TCNFEP_BIZDEF_TREE_L_0') CREATE INDEX IDX_TPO_TCNFEP_BIZDEF_TREE_L_0 ON T_TPO_TCNFEP_BIZDEF_TREE_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_TPO_TCNFEP_BIZDEFENTRY', 'T_TPO_TCNFEP_BIZDEFENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TPO_TCNFEP_BIZDEFENTRY_FK') CREATE INDEX IDX_TPO_TCNFEP_BIZDEFENTRY_FK ON T_TPO_TCNFEP_BIZDEFENTRY ( FID );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TPO_constraint.sql **/
