添加访问日志表及相关字段,更新模型字段注释
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: platform-dev
|
||||
name: server-dev
|
||||
|
||||
services:
|
||||
|
||||
@@ -14,6 +14,16 @@ services:
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
|
||||
postgres-migration:
|
||||
image: postgres:17
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${DB_USERNAME}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
POSTGRES_DB: ${DB_NAME}
|
||||
ports:
|
||||
- "5433:5432"
|
||||
|
||||
redis:
|
||||
image: redis:7.4
|
||||
restart: always
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user