
EXEC P_ALTERPK 'PK_T_BD_MATERIALCALINFO', 'T_BD_MATERIALCALINFO', 'FID', '1';

EXEC P_ALTERPK 'PK_T_BD_MATERIALCATEGORY_L', 'T_BD_MATERIALCATEGORY_L', 'FPKID', '1';

EXEC P_ALTERPK 'PK_T_BD_MATERIALCATEGORY', 'T_BD_MATERIALCATEGORY', 'FID', '1';

EXEC P_ALTERPK 'PK_T_BD_MATERIALCATEGORY_L', 'T_BD_MATERIALCATEGORY_L', 'FPKID', '1';

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_MATERIALCATEGORY_GROUPORG') CREATE INDEX IDX_BD_MATERIALCATEGORY_GROUPORG ON T_BD_MATERIALCALINFO ( FGROUPID ,FCREATEORGID );

-- 受管控策略的基础资料，平台默认会添加组织索引
-- IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_MATERIALCATEGORY_ORG') CREATE INDEX IDX_BD_MATERIALCATEGORY_ORG ON T_BD_MATERIALCALINFO (FCREATEORGID);

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_MATERIALCATEGORY_MASTERORG') CREATE INDEX IDX_BD_MATERIALCATEGORY_MASTERORG ON T_BD_MATERIALCALINFO ( FMASTERID ,FCREATEORGID );



