From df1f628b42bfba01c11b6dd12bd97d7663bb320b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E7=BA=A2=E4=BF=9D?= Date: Tue, 10 Nov 2020 16:11:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85foreignKey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collection/opendb-mall-comments/collection.json | 6 ++++-- collection/opendb-mall-goods/collection.json | 3 ++- collection/opendb-news-articles/collection.json | 9 ++++++--- collection/opendb-news-comments/collection.json | 12 ++++++++---- collection/opendb-news-favorite/collection.json | 6 ++++-- collection/uni-id-task-log/collection.json | 6 ++++-- 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/collection/opendb-mall-comments/collection.json b/collection/opendb-mall-comments/collection.json index 32a2f8f..030925c 100644 --- a/collection/opendb-mall-comments/collection.json +++ b/collection/opendb-mall-comments/collection.json @@ -14,11 +14,13 @@ }, "goods_id": { "bsonType": "string", - "description": "分类 id,参考`opendb-mall-categories`表" + "description": "分类 id,参考`opendb-mall-goods`表", + "foreignKey":"opendb-mall-goods._id" }, "user_id": { "bsonType": "string", - "description": "评论者的uid,参考 uni-id-users 表" + "description": "评论者的uid,参考 uni-id-users 表", + "foreignKey":"uni-id-users._id" }, "content": { "bsonType": "string", diff --git a/collection/opendb-mall-goods/collection.json b/collection/opendb-mall-goods/collection.json index cb41162..4a7e553 100644 --- a/collection/opendb-mall-goods/collection.json +++ b/collection/opendb-mall-goods/collection.json @@ -14,7 +14,8 @@ }, "category_id": { "bsonType": "string", - "description": "分类 id,参考`opendb-mall-categories`表" + "description": "分类 id,参考`opendb-mall-categories`表", + "foreignKey":"opendb-mall-categories._id" }, "goods_sn": { "bsonType": "string", diff --git a/collection/opendb-news-articles/collection.json b/collection/opendb-news-articles/collection.json index 21d1831..c7a32be 100644 --- a/collection/opendb-news-articles/collection.json +++ b/collection/opendb-news-articles/collection.json @@ -14,11 +14,13 @@ }, "user_id": { "bsonType": "string", - "description": "文章作者ID, 参考`uni-id-users` 表" + "description": "文章作者ID, 参考`uni-id-users` 表", + "foreignKey":"uni-id-users._id" }, "category_id": { "bsonType": "string", - "description": "分类 id,参考`uni-news-categories`表" + "description": "分类 id,参考`uni-news-categories`表", + "foreignKey":"opendb-news-categories._id" }, "title": { "bsonType": "string", @@ -84,7 +86,8 @@ }, "last_comment_user_id": { "bsonType": "string", - "description": "最后回复用户 id,参考`uni-id-users` 表" + "description": "最后回复用户 id,参考`uni-id-users` 表", + "foreignKey":"uni-id-users._id" }, "avatar": { "bsonType": "string", diff --git a/collection/opendb-news-comments/collection.json b/collection/opendb-news-comments/collection.json index c6682fa..8e13681 100644 --- a/collection/opendb-news-comments/collection.json +++ b/collection/opendb-news-comments/collection.json @@ -14,14 +14,16 @@ }, "article_id": { "bsonType": "string", - "description": "文章ID,opendb-news-posts 表中的`_id`字段" + "description": "文章ID,opendb-news-posts 表中的`_id`字段", + "foreignKey":"opendb-news-articles._id" }, "user_id": { "bsonType": "string", "description": "评论者ID,参考`uni-id-users` 表", "forceDefaultValue": { "$env": "uid" - } + }, + "foreignKey":"uni-id-users._id" }, "comment_content": { "bsonType": "string", @@ -38,11 +40,13 @@ }, "reply_user_id": { "bsonType": "string", - "description": "被回复的评论用户ID,comment_type为1时有效" + "description": "被回复的评论用户ID,comment_type为1时有效", + "foreignKey":"uni-id-users._id" }, "reply_comment_id": { "bsonType": "string", - "description": "被回复的评论ID,comment_type为1时有效" + "description": "被回复的评论ID,comment_type为1时有效", + "foreignKey":"opendb-news-comments._id" }, "comment_date": { "bsonType": "timestamp", diff --git a/collection/opendb-news-favorite/collection.json b/collection/opendb-news-favorite/collection.json index 21f46cb..86d9680 100644 --- a/collection/opendb-news-favorite/collection.json +++ b/collection/opendb-news-favorite/collection.json @@ -14,14 +14,16 @@ }, "article_id": { "bsonType": "string", - "description": "文章id,参考opendb-news-categories表" + "description": "文章id,参考opendb-news-articles表", + "foreignKey":"opendb-news-articles._id" }, "user_id": { "bsonType": "string", "description": "收藏者id,参考uni-id-users表", "forceDefaultValue": { "$env": "uid" - } + }, + "foreignKey":"uni-id-users._id" }, "create_date": { "bsonType": "timestamp", diff --git a/collection/uni-id-task-log/collection.json b/collection/uni-id-task-log/collection.json index efb74ca..78d0522 100644 --- a/collection/uni-id-task-log/collection.json +++ b/collection/uni-id-task-log/collection.json @@ -8,11 +8,13 @@ }, "user_id": { "bsonType": "string", - "description": "用户id,参考uni-id-users表" + "description": "用户id,参考uni-id-users表", + "foreignKey":"uni-id-users._id" }, "task_id": { "bsonType": "string", - "description": "任务ID" + "description": "任务ID", + "foreignKey":"uni-id-task._id" }, "result": { "bsonType": "bool",