/**Begin C:\PDM_UPGRADE\PDM1\PBD_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_PBD_DATA_SYNC_TRIGGER', 'T_PBD_DATA_SYNC_TRIGGER', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_DATA_SYNC_TRIGGER_L', 'T_PBD_DATA_SYNC_TRIGGER_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESAGGS', 'T_PBD_ESAGGS', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESAGGS_L', 'T_PBD_ESAGGS_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESAGGS_OUTPUT', 'T_PBD_ESAGGS_OUTPUT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESAGGS_SUB', 'T_PBD_ESAGGS_SUB', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESAGGTYPE', 'T_PBD_ESAGGTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESAGGTYPE_L', 'T_PBD_ESAGGTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESCONFIG', 'T_PBD_ESCONFIG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESCONFIG_L', 'T_PBD_ESCONFIG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESCONFIGAGGENTRY', 'T_PBD_ESCONFIGAGGENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESCONFIGENTRY', 'T_PBD_ESCONFIGENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESMAPPINGPROP', 'T_PBD_ESMAPPINGPROP', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESMAPPINGPROP_L', 'T_PBD_ESMAPPINGPROP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESMAPPINGPROP_NESTS', 'T_PBD_ESMAPPINGPROP_NESTS', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESOUTPUT', 'T_PBD_ESOUTPUT', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESOUTPUT_L', 'T_PBD_ESOUTPUT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_ESOUTPUTENTRY', 'T_PBD_ESOUTPUTENTRY', 'FENTRYID', '1';

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



/**End C:\PDM_UPGRADE\PDM1\PBD_constraint.sql **/
