Skip to content

Commit d8bca87

Browse files
committed
PostgreSQL:更新表
1 parent 65d62ba commit d8bca87

File tree

2 files changed

+57
-3
lines changed

2 files changed

+57
-3
lines changed

PostgreSQL/single/postgres_sys_Access.sql

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ create table "Access"
22
(
33
id integer not null
44
primary key,
5-
schema varchar(100), default null,
5+
schema varchar(100) default null,
66
debug integer default 0 not null,
77
name varchar(50) default '实际表名,例如 apijson_user'::character varying not null,
88
alias text,
@@ -13,12 +13,35 @@ create table "Access"
1313
post text default '["OWNER", "ADMIN"]'::text not null,
1414
put text default '["OWNER", "ADMIN"]'::text not null,
1515
delete text default '["OWNER", "ADMIN"]'::text not null,
16-
date text default CURRENT_TIMESTAMP not null
16+
date text default CURRENT_TIMESTAMP not null,
17+
detail text default null
1718
);
1819

20+
comment on column "Access".id is '唯一标识';
21+
22+
comment on column "Access".debug is '是否为调试表,只允许在开发环境使用,测试和线上环境禁用';
23+
24+
comment on column "Access".alias is '外部调用的表别名,例如 User';
25+
26+
comment on column "Access".get is '允许 get 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]
27+
用 JSON 类型不能设置默认值,反正权限对应的需求是明确的,也不需要自动转 JSONArray。
28+
TODO: 直接 LOGIN,CONTACT,CIRCLE,OWNER 更简单,反正是开发内部用,不需要复杂查询。';
29+
30+
comment on column "Access".head is '允许 head 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
31+
32+
comment on column "Access".gets is '允许 gets 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
33+
34+
comment on column "Access".heads is '允许 heads 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
35+
36+
comment on column "Access".post is '允许 post 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
37+
38+
comment on column "Access".put is '允许 put 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
1939

2040
comment on column "Access".delete is '允许 delete 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
2141

42+
comment on column "Access".date is '创建时间';
43+
44+
2245
alter table "Access"
2346
owner to postgres;
2447

PostgreSQL/single/postgres_sys_Document.sql

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,38 @@ create table "Document"
1717
detail text
1818
);
1919

20-
应该用adminId,只有当登录账户是管理员时才能操作文档。
20+
21+
comment on column "Document".id is '唯一标识';
22+
23+
comment on column "Document"."userId" is '用户id
24+
应该用adminId,只有当登录账户是管理员时才能操作文档。
25+
需要先建Admin表,新增登录等相关接口。';
26+
27+
comment on column "Document".version is '接口版本号
28+
<=0 - 不限制版本,任意版本都可用这个接口
29+
>0 - 在这个版本添加的接口';
30+
31+
comment on column "Document".name is '接口名称';
32+
33+
comment on column "Document".url is '请求地址';
34+
35+
comment on column "Document".request is '请求
36+
用json格式会导致强制排序,而请求中引用赋值只能引用上面的字段,必须有序。';
37+
38+
comment on column "Document".response is '标准返回结果JSON
39+
用json格式会导致强制排序,而请求中引用赋值只能引用上面的字段,必须有序。';
40+
41+
comment on column "Document".header is '请求头 Request Header: key: value //注释';
42+
43+
comment on column "Document".date is '创建时间';
44+
45+
comment on column "Document".apijson is '从 request 映射为实际的 APIJSON 请求 JSON';
46+
47+
comment on column "Document".type is 'PARAM - GET url parameters,\nFORM - POST application/www-x-form-url-encoded,\nJSON - POST application/json';
48+
49+
comment on column "Document".sqlauto is '用于 SQLAuto 测试的 SQL 语句';
50+
51+
2152
alter table "Document"
2253
owner to postgres;
2354

0 commit comments

Comments
 (0)