/**Begin D:\PDM_UPGRADE\PDM1\FPM_constraint.sql **/
EXEC P_ALTERPK 'PK_T_FPM_INSPECTION_LOG', 'T_FPM_INSPECTION_LOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_INSPECTION_LOG_BODYSYS') CREATE INDEX IDX_INSPECTION_LOG_BODYSYS ON T_FPM_INSPECTION_LOG ( FBODYSYSID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_INSPECTION_LOG_EXECTIME') CREATE INDEX IDX_INSPECTION_LOG_EXECTIME ON T_FPM_INSPECTION_LOG ( FEXECDATE );


EXEC P_ALTERPK 'PK_T_FPM_INSPECT_LOG_DETAIL', 'T_FPM_INSPECT_LOG_DETAIL', 'FENTRYID', '1';

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


EXEC P_ALTERPK 'PK_T_FPM_INSPECT_LOG_RECORD', 'T_FPM_INSPECT_LOG_RECORD', 'FENTRYID', '1';

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


EXEC P_ALTERPK 'PK_T_FPM_INSPECT_LOG_CONS', 'T_FPM_INSPECT_LOG_CONS', 'FENTRYID', '1';

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


EXEC P_ALTERPK 'PK_T_FPM_LOG_CHAINERROR', 'T_FPM_LOG_CHAINERROR', 'FENTRYID', '1';

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


EXEC P_ALTERPK 'PK_T_FPM_LOG_BIZBILLERROR', 'T_FPM_LOG_BIZBILLERROR', 'FENTRYID', '1';

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


EXEC P_ALTERPK 'PK_T_FPM_INSPECTLOG_PERIOD', 'T_FPM_INSPECTLOG_PERIOD', 'FPKID', '1';

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


EXEC P_ALTERPK 'PK_T_FPM_INSPECTLOG_ORG', 'T_FPM_INSPECTLOG_ORG', 'FPKID', '1';

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



/**End D:\PDM_UPGRADE\PDM1\FPM_constraint.sql **/
