/**Begin D:\PDM_UPGRADE\PDM1\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_COLLECTIONCONFIG', 'T_EB_COLLECTIONCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_COLLECTIONCONFIG_MODEL') CREATE INDEX IDX_EB_COLLECTIONCONFIG_MODEL ON T_EB_COLLECTIONCONFIG ( FMODEL );

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


 EXEC P_ALTERPK 'PK_T_EB_COLLECTIONCONFIG_L', 'T_EB_COLLECTIONCONFIG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_COLLECTIONEXECUTE', 'T_EB_COLLECTIONEXECUTE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_COLLECTIONEXECUTE_MODEL') CREATE INDEX IDX_EB_COLLECTIONEXECUTE_MODEL ON T_EB_COLLECTIONEXECUTE ( FMODEL );

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


 EXEC P_ALTERPK 'PK_T_EB_COLLECTIONRECORD', 'T_EB_COLLECTIONRECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_COLLECTIONRECORD_FMODEL') CREATE INDEX IDX_EB_COLLECTIONRECORD_FMODEL ON T_EB_COLLECTIONRECORD ( FMODEL );


 EXEC P_ALTERPK 'PK_T_EB_COLLECTIONSUPERVISOR', 'T_EB_COLLECTIONSUPERVISOR', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_COLLECTIONSUPERVISOR_L', 'T_EB_COLLECTIONSUPERVISOR_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_DATAENTITYDIMMAP', 'T_EB_DATAENTITYDIMMAP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_DATAENTITYPERIODMAP', 'T_EB_DATAENTITYPERIODMAP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_DATAENTITYYEARMAP', 'T_EB_DATAENTITYYEARMAP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_EBDIMMEMBERMAP', 'T_EB_EBDIMMEMBERMAP', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_EBDIMMEMBERMAP_L', 'T_EB_EBDIMMEMBERMAP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_EBMEMBERMAP', 'T_EB_EBMEMBERMAP', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_EBMEMBERMAP_SEQ') CREATE INDEX IDX_EB_EBMEMBERMAP_SEQ ON T_EB_EBMEMBERMAP ( FSEQ );

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


 EXEC P_ALTERPK 'PK_T_EB_EXECUTEPROJECT', 'T_EB_EXECUTEPROJECT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_DATALOCK', 'T_EB_DATALOCK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX__EB_DATALOCK_P1') CREATE INDEX IDX__EB_DATALOCK_P1 ON T_EB_DATALOCK ( FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX__EB_DATALOCK_P2') CREATE INDEX IDX__EB_DATALOCK_P2 ON T_EB_DATALOCK ( FYEARID ,FCURRENCYID ,FVERSIONID );


 EXEC P_ALTERPK 'PK_T_EB_DATALOCKLOG', 'T_EB_DATALOCKLOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATALOCKLOG_P1') CREATE INDEX IDX_EB_DATALOCKLOG_P1 ON T_EB_DATALOCKLOG ( FMODELID );



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