create table coin_log
(
    id          bigint auto_increment
        primary key,
    ssid        varchar(64)   not null,
    amount      int           not null,
    func_type   varchar(255)  not null,
    create_time datetime      not null,
    update_time datetime      not null,
    status      int default 0 not null
);

create index ssid_index
    on coin_log (ssid);

create table complaint
(
    id          bigint auto_increment
        primary key,
    ssid        varchar(64)   not null,
    uid         bigint        null,
    reason      varchar(255)  null,
    content     varchar(255)  not null,
    phone       varchar(255)  null,
    images      varchar(1000) null,
    create_time datetime      not null,
    update_time datetime      not null,
    status      int default 0 not null
);

create table lottery_roll
(
    user_name varchar(255) null,
    reward    varchar(255) null
);

create table upload_log
(
    id                bigint auto_increment
        primary key,
    ssid              varchar(64)   not null,
    cdn_host          varchar(255)  not null,
    fileKey           varchar(1000) not null,
    original_filename varchar(255)  null,
    ip                varchar(255)  null,
    create_time       datetime      not null,
    update_time       datetime      not null,
    status            int default 0 not null
);

create index ssid_index
    on upload_log (ssid);

create table user_info
(
    ssid           varchar(64)   not null
        primary key,
    uid            bigint        null comment 'ssid的hashCode 仅展示',
    alipay_user_id varchar(128)  null,
    wechat_openid  varchar(128)  null,
    nickname       varchar(255)  null,
    head_img_url   varchar(255)  null,
    create_time    datetime      not null,
    update_time    datetime      not null,
    status         int default 0 not null
);

create table withdraw_log
(
    id              bigint auto_increment
        primary key,
    ssid            varchar(64)   not null,
    device_id       varchar(64)   not null,
    pay_method      int           not null,
    pay_platform    int           not null,
    out_transfer_no varchar(64)   null,
    amount          bigint        not null,
    func_type       varchar(255)  not null,
    create_time     datetime      not null,
    update_time     datetime      not null,
    success_time    datetime      null,
    status          int default 0 not null
);

create index ssid_index
    on withdraw_log (ssid);

create table withdraw_roll
(
    user_name varchar(255) null,
    reward    varchar(255) null
);

