/**BEGIN  **/

-- 先删除索引
IF EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'UX_EB_MEMBERQUOTE')
drop index T_EB_MEMBERQUOTE.UX_EB_MEMBERQUOTE;

-- 再增加数据集字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_MEMBERQUOTE' AND KSQL_COL_NAME IN ('FDATASETID')) 
ALTER TABLE T_EB_MEMBERQUOTE ADD (FDATASETID BIGINT DEFAULT 0  NOT NULL);

-- 再创建唯一索引
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'UX_EB_MEMBERQUOTE')
CREATE UNIQUE INDEX UX_EB_MEMBERQUOTE ON T_EB_MEMBERQUOTE ( FMODELID, FDIMENSIONID, FDATASETID, FMEMBERID, FTYPE );


/**END **/
