/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MAL_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MAL_EMALPAYTYPE_L', 'T_MAL_EMALPAYTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MAL_PAYTYPE_L', 'T_MAL_PAYTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MAL_PAYTYPERELENTRY', 'T_MAL_PAYTYPERELENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_PAYTYPEENTRY_FID_FSEQ') CREATE INDEX IDX_MAL_PAYTYPEENTRY_FID_FSEQ ON T_MAL_PAYTYPERELENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_MAL_EMALPAYTYPE', 'T_MAL_EMALPAYTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_EMALPAYTYPE_FMASTERID') CREATE INDEX IDX_MAL_EMALPAYTYPE_FMASTERID ON T_MAL_EMALPAYTYPE ( FMASTERID );

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


 EXEC P_ALTERPK 'PK_T_MAL_PAYTYPE', 'T_MAL_PAYTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_PAYTYPE_FMASTERID') CREATE INDEX IDX_MAL_PAYTYPE_FMASTERID ON T_MAL_PAYTYPE ( FMASTERID );

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


 EXEC P_ALTERPK 'PK_T_MAL_INVOICETYPE', 'T_MAL_INVOICETYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_INVOICETYPE_FMASTERID') CREATE INDEX IDX_MAL_INVOICETYPE_FMASTERID ON T_MAL_INVOICETYPE ( FMASTERID );

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


 EXEC P_ALTERPK 'PK_T_MAL_INVOICETYPE_L', 'T_MAL_INVOICETYPE_L', 'FPKID', '1';

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



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