create table agreement_document
(
    id             int auto_increment
        primary key,
    name           varchar(255)  null,
    product_name   varchar(255)  not null,
    app_platform   int           not null,
    subject_name   varchar(255)  not null,
    agreement_type varchar(255)  not null,
    content        longtext      not null,
    content_md5    varchar(64)   not null,
    document_key   varchar(64)   not null,
    remark         varchar(255)  null,
    create_time    datetime      not null,
    update_time    datetime      not null,
    status         int default 0 not null,
    constraint document_key_uindex
        unique (document_key)
);

create table subject
(
    id          int auto_increment
        primary key,
    name        varchar(255) not null,
    host        varchar(255) null,
    remark      varchar(255) null,
    create_time datetime     not null,
    update_time datetime     not null,
    status      int          not null,
    constraint subject_index
        unique (name)
);