/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BOS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BAS_COSTCENTER', 'T_BAS_COSTCENTER', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_COSTCENTER_L', 'T_BAS_COSTCENTER_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_SOURCETYPE', 'T_BAS_SOURCETYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_SOURCETYPE_L', 'T_BAS_SOURCETYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_COSTCENTERSOURCE', 'T_BAS_COSTCENTERSOURCE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BAS_COSTCENTERSRC_TYPEDATA') CREATE INDEX IDX_BAS_COSTCENTERSRC_TYPEDATA ON T_BAS_COSTCENTERSOURCE ( FSOURCETYPEID ,FDATAID );

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