/** 预提类型 约束 start **/

EXEC P_ALTERPK 'PK_T_ER_WITHHOLDINGTYPE', 'T_ER_WITHHOLDINGTYPE', 'FID', '1';

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

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_WT_CTRL') CREATE INDEX IDX_ER_WT_CTRL ON T_ER_WITHHOLDINGTYPE ( FCTRLSTRATEGY );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_WT_CREATORORG') CREATE INDEX IDX_ER_WT_CREATORORG ON T_ER_WITHHOLDINGTYPE ( FCREATEORGID );
/** 预提类型 end 约束 **/


/** 预提类型-多语言 约束 start **/
EXEC P_ALTERPK 'PK_T_ER_WITHHOLDINGTYPE_L', 'T_ER_WITHHOLDINGTYPE_L', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_WT_L_FID') CREATE INDEX IDX_ER_WT_L_FID ON T_ER_WITHHOLDINGTYPE_L ( FID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_WT_L_LOCAL') CREATE INDEX IDX_ER_WT_L_LOCAL ON T_ER_WITHHOLDINGTYPE_L ( FLOCALEID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_WT_L_NAME') CREATE INDEX IDX_ER_WT_L_NAME ON T_ER_WITHHOLDINGTYPE_L ( FNAME );
/** 预提类型-多语言 约束 end **/
