/**Begin D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_constraint.sql **/
EXEC P_ALTERPK 'PK_BDM_CUSTOMS_CONFIG', 'T_BDM_CUSTOMS_CONFIG', 'FID', '0';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_CUSTOMS_CONFIG_ORG') CREATE  CLUSTERED INDEX IDX_BDM_CUSTOMS_CONFIG_ORG ON T_BDM_CUSTOMS_CONFIG ( FCREATEORGID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_CUSTOMS_CONFIG_MASTER') CREATE INDEX IDX_BDM_CUSTOMS_CONFIG_MASTER ON T_BDM_CUSTOMS_CONFIG ( FMASTERID );


EXEC P_ALTERPK 'PK_BDM_CUSTOMS_CONFIG_L', 'T_BDM_CUSTOMS_CONFIG_L', 'FPKID', '0';

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

EXEC P_ALTERPK 'PK_BDM_CUSTOMS_REMARK', 'T_BDM_CUSTOMS_REMARK', 'FID', '0';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_CUSTOMS_REMARK_ORG') CREATE  CLUSTERED INDEX IDX_BDM_CUSTOMS_REMARK_ORG ON T_BDM_CUSTOMS_REMARK ( FORGID );

/**End D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_constraint.sql **/
