/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_constraint.sql **/

 EXEC P_ALTERPK 'PK_T_ER_TRIPINVOICEANDITEM', 'T_ER_TRIPINVOICEANDITEM', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TRIPCHECK_FEXPENSEENTRYID') CREATE INDEX IDX_TRIPCHECK_FEXPENSEENTRYID ON T_ER_TRIPINVOICEANDITEM ( FEXPENSEENTRYID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TRIPCHECK_FINVOICEENTRYID') CREATE INDEX IDX_TRIPCHECK_FINVOICEENTRYID ON T_ER_TRIPINVOICEANDITEM ( FINVOICEENTRYID );

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