/**Begin D:\PDM_UPGRADE\PDM1\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_EPM', 'T_BCM_EPM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_EPM') CREATE INDEX IDX_BCM_EPM ON T_BCM_EPM ( FVERSION );


 EXEC P_ALTERPK 'PK_T_BCM_EPM_ATTACH', 'T_BCM_EPM_ATTACH', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_EPM_ATTACH') CREATE INDEX IDX_BCM_EPM_ATTACH ON T_BCM_EPM_ATTACH ( FBASEDATAID );


 EXEC P_ALTERPK 'PK_T_BCM_OPLOGCONSOLE', 'T_BCM_OPLOGCONSOLE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_OPLOGCONSOLE') CREATE INDEX IDX_BCM_OPLOGCONSOLE ON T_BCM_OPLOGCONSOLE ( FSOURCEKEY ,FSUBSOURCEKEY ,FOPCATEGORY );


 EXEC P_ALTERPK 'PK_T_BCM_OPLOGCONSOLE_L', 'T_BCM_OPLOGCONSOLE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_DOCUMENT', 'T_BCM_DOCUMENT', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_DOCUMENT_PARENT') CREATE INDEX IDX_DOCUMENT_PARENT ON T_BCM_DOCUMENT ( FPARENTID );

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


 EXEC P_ALTERPK 'PK_T_BCM_DOCUMENT_L', 'T_BCM_DOCUMENT_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_DOCUMENT_L') CREATE INDEX IDX_BCM_DOCUMENT_L ON T_BCM_DOCUMENT_L ( FID ,FNAME );


 EXEC P_ALTERPK 'PK_T_BCM_FILELISTENTITY', 'T_BCM_FILELISTENTITY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_FILELISTENTITY') CREATE INDEX IDX_BCM_FILELISTENTITY ON T_BCM_FILELISTENTITY ( FNUMBER ,FPARENTID );


 EXEC P_ALTERPK 'PK_T_BCM_FILELISTENTITY_L', 'T_BCM_FILELISTENTITY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_FILELISTENTITY_L') CREATE INDEX IDX_BCM_FILELISTENTITY_L ON T_BCM_FILELISTENTITY_L ( FID ,FNAME );



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