create table if not exists alarm_attribution
(
    id                  bigserial
        primary key,
    alarmid             bigint       null,
    alarmlevel          varchar(30)  null,
    alarmdescriptionchn varchar(255) null,
    alarmdescriptioneng varchar(255) null,
    ismon               int          null,
    updatetime          varchar(20)  null
);

create table if not exists current_alarm
(
    id                  bigserial
        primary key,
    alarmid             bigint       null,
    stationid           int          null,
    deviceid            int          null,
    alarmlevel          varchar(30)  null,
    alarmdescriptionchn varchar(255) null,
    alarmdescriptioneng varchar(255) null,
    reporttime          varchar(20)  null
);

create table if not exists current_performance
(
    id                bigserial
        primary key,
    perid             int          null,
    stationid         int          null,
    deviceid          int          null,
    datacatlog        varchar(40)  null,
    fieldname         varchar(40)  null,
    fieldvalue        varchar(40)  null,
    perdescriptionchn varchar(255) null,
    perdescriptioneng varchar(255) null,
    updatetime        varchar(20)  null
);

create table if not exists history_alarm
(
    id                  bigserial
        primary key,
    alarmid             int          null,
    stationid           int          null,
    deviceid            int          null,
    alarmlevel          varchar(30)  null,
    alarmdescriptionchn varchar(255) null,
    alarmdescriptioneng varchar(255) null,
    starttime           varchar(20)  null,
    endtime             varchar(20)  null
);

create table if not exists history_performance
(
    id    serial
        primary key,
    suid  int          not null,
    value varchar(100) not null,
    time  varchar(30)  not null
);

create table if not exists log_info
(
    id             bigserial
        primary key,
    stationid      int          null,
    deviceid       int          null,
    manipunator    varchar(20)  null,
    loglevel       varchar(20)  null,
    classification varchar(20)  null,
    loginfochn     varchar(500) null,
    loginfoeng     varchar(500) null,
    reporttime     varchar(20)  null
);


create table if not exists per_attribution
(
    id                bigserial
        primary key,
    perid             bigint       null,
    datacatlog        varchar(50)  null,
    fieldname         varchar(50)  null,
    perdescriptionchn varchar(255) null,
    perdescriptioneng varchar(255) null,
    ismon             int          null,
    isfixed           int          null,
    fieldunit         varchar(20)  null,
    fieldtype         varchar(20)  null,
    operator1         varchar(20)  null,
    operand1          varchar(20)  null,
    relation          varchar(20)  null,
    operator2         varchar(20)  null,
    operand2          varchar(20)  null,
    alarmlevel        varchar(20)  null,
    alarmdeschn       varchar(255) null,
    alarmdeseng       varchar(255) null,
    updatetime        varchar(20)  null
);