Skip to content

Commit c3ef50f

Browse files
committed
PostgreSQL:更新表,解决 Function 表中deleteCommentOfMomen 这个 name 最后少了 t
1 parent 9cce47b commit c3ef50f

16 files changed

+712
-1525
lines changed

PostgreSQL/postgres_sys.sql

Lines changed: 494 additions & 901 deletions
Large diffs are not rendered by default.

PostgreSQL/single/postgres_sys_Access.sql

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,3 @@
1-
create table "Access"
2-
(
3-
id integer not null
4-
constraint access_pk
5-
primary key,
6-
debug integer default 0 not null,
7-
name varchar(50) default '实际表名,例如 apijson_user'::character varying not null,
8-
alias text,
9-
get text default '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]'::text not null,
10-
head text default '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]'::text not null,
11-
gets text default '["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]'::text not null,
12-
heads text default '["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]'::text not null,
13-
post text default '["OWNER", "ADMIN"]'::text not null,
14-
put text default '["OWNER", "ADMIN"]'::text not null,
15-
delete text default '["OWNER", "ADMIN"]'::text not null,
16-
date text default CURRENT_TIMESTAMP not null
17-
);
18-
19-
comment on column "Access".id is '唯一标识';
20-
21-
comment on column "Access".debug is '是否为调试表,只允许在开发环境使用,测试和线上环境禁用';
22-
23-
comment on column "Access".alias is '外部调用的表别名,例如 User';
24-
25-
comment on column "Access".get is '允许 get 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]
26-
用 JSON 类型不能设置默认值,反正权限对应的需求是明确的,也不需要自动转 JSONArray。
27-
TODO: 直接 LOGIN,CONTACT,CIRCLE,OWNER 更简单,反正是开发内部用,不需要复杂查询。';
28-
29-
comment on column "Access".head is '允许 head 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
30-
31-
comment on column "Access".gets is '允许 gets 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
32-
33-
comment on column "Access".heads is '允许 heads 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
34-
35-
comment on column "Access".post is '允许 post 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
36-
37-
comment on column "Access".put is '允许 put 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
38-
39-
comment on column "Access".delete is '允许 delete 的角色列表,例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]';
40-
41-
comment on column "Access".date is '创建时间';
42-
43-
alter table "Access"
44-
owner to postgres;
45-
46-
create unique index access_alias_uindex
47-
on "Access" (alias);
48-
491
INSERT INTO sys."Access" (id, debug, name, alias, get, head, gets, heads, post, put, delete, date) VALUES (1, 1, 'Access', '', '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '[]', '[]', '[]', '2019-07-21 12:21:36');
502
INSERT INTO sys."Access" (id, debug, name, alias, get, head, gets, heads, post, put, delete, date) VALUES (2, 1, 'Table', null, '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '[]', '[]', '[]', '2018-11-28 16:38:14');
513
INSERT INTO sys."Access" (id, debug, name, alias, get, head, gets, heads, post, put, delete, date) VALUES (3, 1, 'Column', null, '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]', '[]', '[]', '[]', '2018-11-28 16:38:14');

PostgreSQL/single/postgres_sys_Comment.sql

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
create table "Comment"
2-
(
3-
id bigint not null
4-
constraint "Comment_pkey"
5-
primary key,
6-
"toId" bigint default 0 not null,
7-
"userId" bigint not null,
8-
"momentId" bigint not null,
9-
date timestamp(6),
10-
content varchar(1000) not null
11-
);
12-
13-
comment on table "Comment" is '评论';
14-
15-
comment on column "Comment".id is '唯一标识';
16-
17-
comment on column "Comment"."toId" is '被回复的id';
18-
19-
comment on column "Comment"."userId" is '评论人id';
20-
21-
comment on column "Comment"."momentId" is '动态id';
22-
23-
comment on column "Comment".date is '创建日期';
24-
25-
comment on column "Comment".content is '内容';
26-
27-
alter table "Comment"
28-
owner to postgres;
29-
301
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (4, 0, 38710, 470, '2017-02-01 11:20:50.000000', 'This is a Content...-4');
312
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (13, 0, 82005, 58, '2017-02-01 11:20:50.000000', 'This is a Content...-13');
323
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (22, 221, 82001, 470, '2017-02-01 11:20:50.000000', '测试修改评论');
@@ -528,4 +499,31 @@ INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALU
528499
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1562814013816, 0, 82001, 1562556720665, '2019-07-11 03:00:13.000000', 'xxxx');
529500
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1562814021942, 1562814013816, 82001, 1562556720665, '2019-07-11 03:00:21.000000', 'xxxx');
530501
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1563506794618, 0, 82001, 15, '2019-07-19 03:26:34.000000', '测试新增评论');
531-
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1563641514400, 0, 82001, 1563605336326, '2019-07-20 16:51:54.000000', '年轻人不要想不开');
502+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1563641514400, 0, 82001, 1563605336326, '2019-07-20 16:51:54.000000', '年轻人不要想不开');
503+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1570199485130, 0, 82001, 15, null, '测试新增评论');
504+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1570357593954, 0, 82001, 15, null, '测试新增评论');
505+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1570357613617, 0, 82001, 15, null, '测试新增评论');
506+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1570524542455, 0, 82001, 15, null, '测试新增评论');
507+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1570611593196, 0, 82001, 15, null, '测试新增评论');
508+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1570611884292, 0, 82001, 15, null, '测试新增评论');
509+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127141506, 0, 82001, 15, null, '测试新增评论');
510+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127146874, 0, 82002, 15, null, '测试新增评论');
511+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127152654, 0, 82003, 15, null, '测试新增评论');
512+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127171390, 0, 82001, 15, null, '测试新增评论');
513+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127176972, 0, 82002, 15, null, '测试新增评论');
514+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127182660, 0, 82003, 15, null, '测试新增评论');
515+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127220673, 0, 82001, 15, null, '测试新增评论');
516+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127225286, 0, 82002, 15, null, '测试新增评论');
517+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127230152, 0, 82003, 15, null, '测试新增评论');
518+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127564313, 0, 82001, 15, null, '测试新增评论');
519+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127568513, 0, 82002, 15, null, '测试新增评论');
520+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127573536, 0, 82003, 15, null, '测试新增评论');
521+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127695250, 0, 82001, 15, null, '测试新增评论');
522+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127699686, 0, 82002, 15, null, '测试新增评论');
523+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127704277, 0, 82003, 15, null, '测试新增评论');
524+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127720172, 0, 82001, 15, null, '测试新增评论');
525+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127724383, 0, 82002, 15, null, '测试新增评论');
526+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601127728638, 0, 82003, 15, null, '测试新增评论');
527+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1601132118675, 0, 82001, 15, null, '测试新增评论');
528+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1612038997561, 0, 82001, 15, null, '测试新增评论');
529+
INSERT INTO sys."Comment" (id, "toId", "userId", "momentId", date, content) VALUES (1612039188938, 0, 82001, 15, null, '测试新增评论');

PostgreSQL/single/postgres_sys_Document.sql

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,3 @@
1-
create table "Document"
2-
(
3-
id bigint not null
4-
constraint "Document_pkey"
5-
primary key,
6-
"userId" bigint not null,
7-
version smallint not null,
8-
name varchar(100) not null,
9-
url varchar(250) not null,
10-
request text not null,
11-
response text,
12-
header text,
13-
date timestamp
14-
);
15-
16-
comment on table "Document" is '测试用例文档
17-
后端开发者在测试好后,把选好的测试用例上传,这样就能共享给前端/客户端开发者';
18-
19-
comment on column "Document".id is '唯一标识';
20-
21-
comment on column "Document"."userId" is '用户id
22-
应该用adminId,只有当登录账户是管理员时才能操作文档。
23-
需要先建Admin表,新增登录等相关接口。';
24-
25-
comment on column "Document".version is '接口版本号
26-
<=0 - 不限制版本,任意版本都可用这个接口
27-
>0 - 在这个版本添加的接口';
28-
29-
comment on column "Document".name is '接口名称';
30-
31-
comment on column "Document".url is '请求地址';
32-
33-
comment on column "Document".request is '请求
34-
用json格式会导致强制排序,而请求中引用赋值只能引用上面的字段,必须有序。';
35-
36-
comment on column "Document".response is '标准返回结果JSON
37-
用json格式会导致强制排序,而请求中引用赋值只能引用上面的字段,必须有序。';
38-
39-
comment on column "Document".header is '请求头 Request Header:
40-
key: value //注释';
41-
42-
comment on column "Document".date is '创建时间';
43-
44-
alter table "Document"
45-
owner to postgres;
46-
471
INSERT INTO sys."Document" (id, "userId", version, name, url, request, response, header, date) VALUES (1, 0, 1, '登录', '/login', '{"type": 0, "phone": "13000082001", "version": 1, "password": "123456"}', null, null, '2017-11-26 07:35:19.000000');
482
INSERT INTO sys."Document" (id, "userId", version, name, url, request, response, header, date) VALUES (2, 0, 1, '注册(先获取验证码type:1)', '/register', '{
493
"Privacy": {
Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,14 @@
1-
create table "Function"
2-
(
3-
id bigint not null
4-
constraint "Function_pkey"
5-
primary key,
6-
name varchar(20) not null,
7-
arguments varchar(100),
8-
demo text not null,
9-
detail varchar(1000),
10-
date timestamp(6) not null,
11-
back varchar(45),
12-
requestlist varchar(45),
13-
"userId" bigint default 0,
14-
type varchar(45) default 'Object'::character varying
15-
);
16-
17-
comment on table "Function" is '远程函数。强制在启动时校验所有demo是否能正常运行通过';
18-
19-
comment on column "Function".name is '方法名';
20-
21-
comment on column "Function".arguments is '参数列表,每个参数的类型都是 String。
22-
用 , 分割的字符串 比 [JSONArray] 更好,例如 array,item ,更直观,还方便拼接函数。';
23-
24-
comment on column "Function".demo is '可用的示例。';
25-
26-
comment on column "Function".detail is '详细描述';
27-
28-
comment on column "Function".date is '创建时间';
29-
30-
comment on column "Function".back is '返回类型';
31-
32-
comment on column "Function".requestlist is 'Request 的 id 列表';
33-
34-
comment on column "Function"."userId" is '用户id';
35-
36-
comment on column "Function".type is '返回类型';
37-
38-
alter table "Function"
39-
owner to postgres;
40-
411
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (3, 'countArray', 'array', '{"array": [1, 2, 3]}', '获取数组长度。没写调用键值对,会自动补全 "result()": "countArray(array)"', '2018-10-13 08:23:23.000000', null, null, 0, 'Object');
422
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (4, 'countObject', 'object', '{"object": {"key0": 1, "key1": 2}}', '获取对象长度。', '2018-10-13 08:23:23.000000', null, null, 0, 'Object');
433
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (5, 'isContain', 'array,value', '{"array": [1, 2, 3], "value": 2}', '判断是否数组包含值。', '2018-10-13 08:23:23.000000', null, null, 0, 'Object');
444
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (6, 'isContainKey', 'object,key', '{"key": "id", "object": {"id": 1}}', '判断是否对象包含键。', '2018-10-13 08:30:31.000000', null, null, 0, 'Object');
455
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (7, 'isContainValue', 'object,value', '{"value": 1, "object": {"id": 1}}', '判断是否对象包含值。', '2018-10-13 08:30:31.000000', null, null, 0, 'Object');
466
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (8, 'getFromArray', 'array,position', '{"array": [1, 2, 3], "result()": "getFromArray(array,1)"}', '根据下标获取数组里的值。position 传数字时直接作为值,而不是从所在对象 request 中取值', '2018-10-13 08:30:31.000000', null, null, 0, 'Object');
477
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (9, 'getFromObject', 'object,key', '{"key": "id", "object": {"id": 1}}', '根据键获取对象里的值。', '2018-10-13 08:30:31.000000', null, null, 0, 'Object');
48-
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (10, 'deleteCommentOfMoment', 'momentId', '{"momentId": 1}', '根据动态 id 删除它的所有评论', '2019-08-17 18:46:56.000000', null, null, 0, 'Object');
498
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (11, 'verifyIdList', 'array', '{"array": [1, 2, 3], "result()": "verifyIdList(array)"}', '校验类型为 id 列表', '2019-08-17 19:58:33.000000', null, null, 0, 'Object');
509
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (12, 'verifyURLList', 'array', '{"array": ["http://123.com/1.jpg", "http://123.com/a.png", "http://www.abc.com/test.gif"], "result()": "verifyURLList(array)"}', '校验类型为 URL 列表', '2019-08-17 19:58:33.000000', null, null, 0, 'Object');
5110
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (13, 'getWithDefault', 'value,defaultValue', '{"value": null, "defaultValue": 1}', '如果 value 为 null,则返回 defaultValue', '2019-08-20 15:26:36.000000', null, null, 0, 'Object');
5211
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (14, 'removeKey', 'key', '{"key": "s", "key2": 2}', '从对象里移除 key', '2019-08-20 15:26:36.000000', null, null, 0, 'Object');
5312
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (15, 'getFunctionDemo', null, '{}', '获取远程函数的 Demo', '2019-08-20 15:26:36.000000', null, null, 0, 'Object');
54-
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (16, 'getFunctionDetail', null, '{}', '获取远程函数的详情', '2019-08-20 15:26:36.000000', null, null, 0, 'Object');
13+
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (16, 'getFunctionDetail', null, '{}', '获取远程函数的详情', '2019-08-20 15:26:36.000000', null, null, 0, 'Object');
14+
INSERT INTO sys."Function" (id, name, arguments, demo, detail, date, back, requestlist, "userId", type) VALUES (10, 'deleteCommentOfMoment', 'momentId', '{"momentId": 1}', '根据动态 id 删除它的所有评论', '2019-08-17 18:46:56.000000', null, null, 0, 'Object');

PostgreSQL/single/postgres_sys_Login.sql

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
create table "Login"
2-
(
3-
id bigint not null
4-
constraint "Login_pkey"
5-
primary key,
6-
"userId" bigint not null,
7-
type smallint not null,
8-
date timestamp(6) not null
9-
);
10-
11-
comment on table "Login" is '@deprecated,登录信息存session';
12-
13-
comment on column "Login".id is '唯一标识';
14-
15-
comment on column "Login"."userId" is '用户id';
16-
17-
comment on column "Login".type is '类型
18-
0-密码登录
19-
1-验证码登录';
20-
21-
comment on column "Login".date is '创建日期';
22-
23-
alter table "Login"
24-
owner to postgres;
25-
261
INSERT INTO sys."Login" (id, "userId", type, date) VALUES (1488365732208, 0, 0, '2017-03-01 10:55:32.000000');
272
INSERT INTO sys."Login" (id, "userId", type, date) VALUES (1488379391681, 1488378558927, 0, '2017-03-01 14:43:11.000000');
283
INSERT INTO sys."Login" (id, "userId", type, date) VALUES (1488379908786, 1488378449469, 0, '2017-03-01 14:51:48.000000');

0 commit comments

Comments
 (0)