drop table if exists `bpm_process_copy`;
create table `bpm_process_copy`
(
    `id`              bigint NOT NULL auto_increment comment '抄送主键',
    `title`           varchar(255)    default '' comment '抄送标题',
    `process_id`      varchar(64)     default '' comment '流程主键',
    `process_name`    varchar(255)    default '' comment '流程名称',
    `category_id`     varchar(255)    default '' comment '流程分类主键',
    `deployment_id`   varchar(64)     default '' comment '部署主键',
    `instance_id`     varchar(64)     default '' comment '流程实例主键',
    `task_id`         varchar(64)     default '' comment '任务主键',
    `user_id`         bigint          default null comment '用户主键',
    `originator_id`   bigint          default null comment '发起人主键',
    `originator_name` varchar(64)     default '' comment '发起人名称',
    `creator`         varchar(64)     default '' comment '创建者',
    `create_time`     datetime        default null comment '创建时间',
    `updater`         varchar(64)     default '' comment '更新者',
    `update_time`     datetime        default null comment '更新时间',
    `deleted`         bit(1) NOT NULL DEFAULT b'0' comment '是否删除',
    primary key (`id`),
    key(`user_id`),
    key(`process_id`),
    key(`create_time`)
) comment='流程抄送表';



alter table ecw_order_exception
    ADD order_exception_amount_currency_id bigint DEFAULT NULL COMMENT '异常币种ID' AFTER order_exception_amount;


alter table ecw_order_exception
    ADD order_exception_notes longtext DEFAULT NULL COMMENT '异常备注' AFTER order_exception_amount_currency_id;


alter table ecw_receipt_item
    ADD account_bank_name varchar(100) DEFAULT NULL COMMENT '收款账号银行名称' AFTER account_name;


alter table ecw_receivable
    ADD payment_user varchar(100) DEFAULT NULL COMMENT '付款人' AFTER `source`;


alter table ecw_receivable
    ADD `fee_source` tinyint(1) DEFAULT NULL COMMENT '费用来源：1 订单计算 2 费用申请 3 特需费用' AFTER `state`;



alter table ecw_customer
    ADD credit_level tinyint(3) DEFAULT 3 COMMENT '信用等级' AFTER `level`;


alter table ecw_customer_level_log
    ADD rule_score int COMMENT '规则得分' AFTER `rule_id`;
alter table ecw_customer_level_log
    ADD order_id bigint COMMENT '订单id' AFTER `rule_id`;
alter table ecw_customer_level_log
    ADD order_no varchar(64) COMMENT '订单编号' AFTER `rule_id`;


alter table ecw_customer_credit_log
    ADD rule_score int COMMENT '规则得分' AFTER `rule_id`;
alter table ecw_customer_credit_log
    ADD order_id bigint COMMENT '订单id' AFTER `rule_id`;
alter table ecw_customer_credit_log
    ADD order_no varchar(64) COMMENT '订单编号' AFTER `rule_id`;



