/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MSPLAN_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MSPLAN_DATALINE', 'T_MSPLAN_DATALINE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_MSPLAN_HOLIDAY', 'T_MSPLAN_HOLIDAY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_MSPLAN_PERSON_COLOR', 'T_MSPLAN_PERSON_COLOR', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_MSPLAN_QUICK_DFILED', 'T_MSPLAN_QUICK_DFILED', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_MSPLAN_FENTRYETY_L', 'T_MSPLAN_FENTRYETY_L', 'FPKID', '1'; 
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_FENTRYETY_L') CREATE INDEX IDX_MSPLAN_FENTRYETY_L ON T_MSPLAN_FENTRYETY_L ( FENTRYID,FLOCALEID );
 

 EXEC P_ALTERPK 'PK_MSPLAN_ENTITY_CONDITION', 'T_MSPLAN_ENTITY_CONDITION', 'FDETAILID', '1'; 
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MSPLAN_ENTITY_COND_FS') CREATE INDEX IDX_MSPLAN_ENTITY_COND_FS ON T_MSPLAN_ENTITY_CONDITION ( FENTRYID,FSEQ );

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