drop table sys_log_platform_analysis;
create table sys_log_platform_analysis
(
    id varchar(50) PRIMARY key,
    env  varchar(50),
    session_id varchar(200),
    url_path varchar(200) not null default '#1',
    user_id varchar(200) not null default '#1',
    org_id varchar(200) not null default '#1',
    ip_address varchar(200) not null default '#1',
    created_time TIMESTAMP not null default CURRENT_TIMESTAMP,
    elevel varchar(20) not null default 'ERROR',
    traceId varchar(50) not null default '#1',
    thread varchar(50)  null,
    logger varchar(150) not null default '#1',
    message varchar(2000)  null,
    response_status varchar(10),
    error text
);

#内网, Id采用自增长的方式
create table sys_log_platform_analysis
(
    id bigint AUTO_INCREMENT PRIMARY key,
    env  varchar(50),
    session_id varchar(200),
    url_path varchar(200) not null default '#1',
    user_id varchar(200) not null default '#1',
    org_id varchar(200) not null default '#1',
    ip_address varchar(200) not null default '#1',
    created_time TIMESTAMP not null default CURRENT_TIMESTAMP,
    elevel varchar(20) not null default 'ERROR',
    traceId varchar(50) not null default '#1',
    thread varchar(50)  null,
    logger varchar(150) not null default '#1',
    message varchar(2000)  null,
    response_status varchar(10),
    error text
);

alter table sys_log_platform_analysis add track_time varchar(30);
alter table sys_log_platform_analysis add track_end_time varchar(30);


#记录审计日志信息
use obpm2;
create table sys_deletion_logs
(
    id           bigint AUTO_INCREMENT PRIMARY key,
    user_id      varchar(200) not null default '#1',
    orgId       varchar(200) not null default '#1',
    url       varchar(500) not null default '#1',
    content      text,
    created_time TIMESTAMP    not null default CURRENT_TIMESTAMP,
);

alter table sys_deletion_logs
    add business_id varchar(255) not null default '#1';

alter table sys_deletion_logs
    add track_id varchar(255) not null default '#1';
alter table sys_deletion_logs
drop column orgId;
alter table sys_deletion_logs
add org_id varchar(200) not null default '#1';
