--退货申请单分录新增关联表，需要预置升级数据，直接从退货申请单分录读取并写入
IF NOT EXISTS (SELECT 1 FROM T_SM_RETURNAPPLYENTRY_R)
INSERT INTO T_SM_RETURNAPPLYENTRY_R(FENTRYID,FID,FPRODUCTTYPE) (select FENTRYID,FID, 'standard' from T_SM_RETURNAPPLYENTRY);

--销售订单变更单新增关联表，需要迁移数据
IF NOT EXISTS (SELECT 1 FROM T_SM_XSALORDER_R)
INSERT INTO T_SM_XSALORDER_R(FID,FCHANGECANCELSTATUS,FCHANGECANCELER,FCHANGECANCELDATE) (select FID, FCHANGECANCELSTATUS,FCHANGECANCELER,FCHANGECANCELDATE from T_SM_XSALORDER);