/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_ER_SEATGRADE_L', 'T_ER_SEATGRADE_L', 'FPKID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SEATGRADE_L_ID') CREATE INDEX IDX_SEATGRADE_L_ID ON T_ER_SEATGRADE_L ( FID ,FLOCALEID );
 
 EXEC P_ALTERPK 'PK_T_ER_SEATGRADE', 'T_ER_SEATGRADE', 'FID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_ER_SEATGRADE_SEAT') CREATE INDEX IDX_T_ER_SEATGRADE_SEAT ON T_ER_SEATGRADE ( FSEATGRADE );
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_ER_SEATGRADE_NUMBER') CREATE INDEX IDX_T_ER_SEATGRADE_NUMBER ON T_ER_SEATGRADE ( FNUMBER );
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_ER_SEATGRADE_ATTRBT') CREATE INDEX IDX_T_ER_SEATGRADE_ATTRBT ON T_ER_SEATGRADE ( FATTRIBUTE );

 EXEC P_ALTERPK 'PK_T_ER_TRIPITEMSEATGRADE', 'T_ER_TRIPITEMSEATGRADE', 'FPKID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_ER_TRIPSEATGRADE') CREATE INDEX IDX_T_ER_TRIPSEATGRADE ON T_ER_TRIPITEMSEATGRADE ( FBASEDATAID );

 EXEC P_ALTERPK 'PK_T_ER_SEATGRADE_R3', 'T_ER_SEATGRADE_R3', 'FID', '1';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_ER_SEATGRADE_R3') CREATE INDEX IDX_T_ER_SEATGRADE_R3 ON T_ER_SEATGRADE_R3 ( FREFSTATUS );
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_constraint.sql **/
