

-- 索引 BOM版本规则

EXEC P_ALTERPK 'PK_BD_BOMVERSIONRULE', 'T_BD_BOMVERSIONRULE', 'FID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_BOMVERSIONRULE') CREATE INDEX IDX_BD_BOMVERSIONRULE ON T_BD_BOMVERSIONRULE ( FNUMBER ,FCREATEORGID );

EXEC P_ALTERPK 'PK_BD_BOMVERSIONRULE_L', 'T_BD_BOMVERSIONRULE_L', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_BOMVERSIONRULE_L') CREATE INDEX IDX_BD_BOMVERSIONRULE_L ON T_BD_BOMVERSIONRULE_L ( FID ,FLOCALEID );


EXEC P_ALTERPK 'PK_BD_BOMVERSIONRULEENTRY', 'T_BD_BOMVERSIONRULEENTRY', 'FENTRYID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_BOMVERSIONRULEENTRY') CREATE INDEX IDX_BD_BOMVERSIONRULEENTRY ON T_BD_BOMVERSIONRULEENTRY ( FID ,FSEQ );

EXEC P_ALTERPK 'PK_BD_BOMVERSIONRULEENTRY_L', 'T_BD_BOMVERSIONRULEENTRY_L', 'FPKID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_BOMVERSIONRULEENTRY_L') CREATE INDEX IDX_BD_BOMVERSIONRULEENTRY_L ON T_BD_BOMVERSIONRULEENTRY_L ( FENTRYID ,FLOCALEID );