diff --git a/collection/opendb-news-favorite/collection.json b/collection/opendb-news-favorite/collection.json new file mode 100644 index 0000000..ddce4fb --- /dev/null +++ b/collection/opendb-news-favorite/collection.json @@ -0,0 +1,20 @@ +{ + "schema": { + "bsonType": "object", + "required": ["user_id", "article_id"], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "article_id": { + "bsonType": "string", + "description": "文章id,参考opendb-news-categories表" + }, + "user_id": { + "bsonType": "string", + "description": "收藏者id,参考uni-id-users表" + } + } + }, + "index": [] +} diff --git a/collection/opendb-news-favorite/package.json b/collection/opendb-news-favorite/package.json new file mode 100644 index 0000000..63c3bbb --- /dev/null +++ b/collection/opendb-news-favorite/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/opendb-news-favorite", + "version": "0.0.1", + "description": "opendb-news-favorite", + "keywords": ["收藏文章", "favorite"], + "opendb": { + "title": "收藏文章", + "type": "collection", + "contributors": [ + { + "name": "DCloud", + "email": "", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} diff --git a/collection/uni-id-followers/collection.json b/collection/uni-id-followers/collection.json index cc7b3f1..6ca5b04 100644 --- a/collection/uni-id-followers/collection.json +++ b/collection/uni-id-followers/collection.json @@ -1,7 +1,7 @@ { "schema": { "bsonType": "object", - "required": ["user_id"], + "required": ["friend_uid", "follow_uid"], "properties": { "_id": { "description": "ID,系统自动生成" diff --git a/database/opendb-news/db_init.json b/database/opendb-news/db_init.json index d280a4d..754f1ed 100644 --- a/database/opendb-news/db_init.json +++ b/database/opendb-news/db_init.json @@ -1,5 +1,6 @@ { "opendb-news-articles": {}, "opendb-news-categories": {}, - "opendb-news-comments": {} + "opendb-news-comments": {}, + "opendb-news-favorite": {} }