
--授权类别
 EXEC P_ALTERPK 'PK_FMM_AUTHCATE', 'T_FMM_AUTHCATE', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_AUTHTE_FCREATETIME') CREATE INDEX IDX_FMM_AUTHTE_FCREATETIME ON T_FMM_AUTHCATE ( FCREATETIME );

--授权类别多语言
 EXEC P_ALTERPK 'PK_FMM_AUTHCATE_L', 'T_FMM_AUTHCATE_L', 'FPKID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_AUTHTEL_FNAME') CREATE INDEX IDX_FMM_AUTHTEL_FNAME ON T_FMM_AUTHCATE_L ( FNAME );

--授权级别
 EXEC P_ALTERPK 'PK_FMM_AUTHLEVEL', 'T_FMM_AUTHLEVEL', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_AUTHEL_FCREATETIME') CREATE INDEX IDX_FMM_AUTHEL_FCREATETIME ON T_FMM_AUTHLEVEL ( FCREATETIME );

--授权级别多语言
 EXEC P_ALTERPK 'PK_FMM_AUTHLEVEL_L', 'T_FMM_AUTHLEVEL_L', 'FPKID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_AUTHELL_FNAME') CREATE INDEX IDX_FMM_AUTHELL_FNAME ON T_FMM_AUTHLEVEL_L ( FNAME );

--授权类型
 EXEC P_ALTERPK 'PK_FMM_AUTHTYPE', 'T_FMM_AUTHTYPE', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_AUTHPE_FCREATETIME') CREATE INDEX IDX_FMM_AUTHPE_FCREATETIME ON T_FMM_AUTHTYPE ( FCREATETIME );

--授权类型多语言
  EXEC P_ALTERPK 'PK_FMM_AUTHTYPE_L', 'T_FMM_AUTHTYPE_L', 'FPKID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_AUTHPEL_FNAME') CREATE INDEX IDX_FMM_AUTHPEL_FNAME ON T_FMM_AUTHTYPE_L ( FNAME );
