SET FOREIGN_KEY_CHECKS=0;

ALTER TABLE `bod_trade_position` ADD INDEX `bod_trade_position_Index2`(`ValueDate`, `HedgeUniqueCode`) USING BTREE;

ALTER TABLE `clientcash_log` ADD COLUMN `Explain` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '变更说明' AFTER `OptDate`;

CREATE TABLE `clientcashincashout_update`  (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `ClientcashincashoutId` int NOT NULL COMMENT '关联clientcashincashout表Id',
  `OldMoney` double(18, 2) NOT NULL COMMENT '修改前金额',
  `NewMoney` double(18, 2) NOT NULL COMMENT '修改后金额',
  `State` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '状态(修改待确认，已拒绝，已确认)',
  `ValidState` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否有效',
  `OptId` int NOT NULL COMMENT '操作人ID',
  `OptName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作人名称',
  `OptDate` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
  `OldDirection` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改前出入金方向',
  `NewDirection` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改后出入金方向',
  `OldHappenDate` datetime(0) NULL DEFAULT NULL COMMENT '修改前出入金时间',
  `NewHappenDate` datetime(0) NULL DEFAULT NULL COMMENT '修改后出入金时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '已确认已结算状态资金金额修改记录' ROW_FORMAT = DYNAMIC;

ALTER TABLE `trade` ADD COLUMN `IsApproval` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否走审批' AFTER `SettlementFlagOptId`;

SET FOREIGN_KEY_CHECKS=1;