添加访问日志表及相关字段,更新模型字段注释

This commit is contained in:
2025-05-08 10:46:21 +08:00
parent 0e0affb008
commit c93d0bf467
37 changed files with 664 additions and 242 deletions

View File

@@ -21,6 +21,44 @@ $$;
-- region 管理员信息
-- ====================
-- logs_request
drop table if exists logs_request cascade;
create table logs_request (
id serial primary key,
identity int,
visitor int,
ip varchar(45) not null,
ua varchar(255),
method varchar(10) not null,
path varchar(255) not null,
status int not null,
error varchar(255),
time timestamp default current_timestamp
);
-- logs_access表字段注释
comment on table logs_request is '访问日志表';
comment on column logs_request.id is '访问日志ID';
comment on column logs_request.identity is '访客身份0-游客1-用户2-服务3-管理员';
comment on column logs_request.visitor is '访客ID';
comment on column logs_request.ip is 'IP地址';
comment on column logs_request.ua is '用户代理';
comment on column logs_request.method is '请求方法';
comment on column logs_request.path is '请求路径';
comment on column logs_request.status is '响应状态码';
comment on column logs_request.error is '错误信息';
comment on column logs_request.time is '请求时间';
-- endregion
-- ====================
-- region 管理员信息
-- ====================
-- admin
drop table if exists admin cascade;
create table admin (