/**Begin D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_constraint.sql **/

 EXEC P_ALTERPK 'PK_T_BCM_LOCKSCOPE', 'T_BCM_LOCKSCOPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_LOCKSCOPE' AND KSQL_INDNAME = 'IDX_BCM_LOCKSCOPE') CREATE UNIQUE INDEX IDX_BCM_LOCKSCOPE ON T_BCM_LOCKSCOPE ( FCOMBINEKEY ,FMODELID ,FSTAGEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_LOCKSCOPE' AND KSQL_INDNAME = 'IDX_BCM_LOCKSCOPEMODEL') CREATE INDEX IDX_BCM_LOCKSCOPEMODEL ON T_BCM_LOCKSCOPE ( FMODELID ,FSCENE ,FYEAR ,FPERIOD ,FCURRENCY );


 EXEC P_ALTERPK 'PK_T_BCM_LOCKSCOPEORG', 'T_BCM_LOCKSCOPEORG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_LOCKSCOPEORG' AND KSQL_INDNAME = 'IDX_BCM_LOCKSCOPEORG') CREATE INDEX IDX_BCM_LOCKSCOPEORG ON T_BCM_LOCKSCOPEORG ( FLOCKSCOPEID ,FORG );



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