/**Begin D:\PDM_UPGRADE\PDM1\LOG_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BDLOG_OPTYPE', 'T_BDLOG_OPTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BDLOG_OPTYPE_L', 'T_BDLOG_OPTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BDLOG_LOG', 'T_BDLOG_LOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BDLOG_LOG_OBJ') CREATE INDEX IDX_T_BDLOG_LOG_OBJ ON T_BDLOG_LOG ( FOPERATOBJ );


 EXEC P_ALTERPK 'PK_T_BDLOG_DATAENTRY', 'T_BDLOG_DATAENTRY', 'FDATAENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BDLOG_ORGENTRY', 'T_BDLOG_ORGENTRY', 'FORGENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BDLOG_FAILCAUSEDETAIL', 'T_BDLOG_FAILCAUSEDETAIL', 'FFAILDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BDLOG_FAILCAUSEDETAIL_ID') CREATE INDEX IDX_T_BDLOG_FAILCAUSEDETAIL_ID ON T_BDLOG_FAILCAUSEDETAIL ( FORGENTRYID );


 EXEC P_ALTERPK 'PK_T_BDLOG_ARCHIVELOG', 'T_BDLOG_ARCHIVELOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BDLOG_ARCHIVELOG_OBJ') CREATE INDEX IDX_T_BDLOG_ARCHIVELOG_OBJ ON T_BDLOG_ARCHIVELOG ( FOPERATOBJ );


 EXEC P_ALTERPK 'PK_T_BDLOG_ARCHIVEDATAENTRY', 'T_BDLOG_ARCHIVEDATAENTRY', 'FDATAENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BDLOG_ARCHIVEORGENTRY', 'T_BDLOG_ARCHIVEORGENTRY', 'FORGENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_BDLOG_ARCHIVEFAILDETAIL', 'T_BDLOG_ARCHIVEFAILDETAIL', 'FFAILDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDLOG_ARCHIVEFAILDETAIL_ID') CREATE INDEX IDX_BDLOG_ARCHIVEFAILDETAIL_ID ON T_BDLOG_ARCHIVEFAILDETAIL ( FORGENTRYID );



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