---
langs: en
tags: cofacts
title: Cofacts DB Mapping
GA: UA-98468513-3
description: Updated at 2020/5/7
---
# Cofacts DB Mapping
> https://github.com/cofacts/rumors-db/tree/master/schema
- ๐: field used in `_id` key; combinations must be unique within index.
- Solid line: foreign key relation
- Dotted line: cached field, or having interaction
```graphviz
graph mappings{
rankdir=LR;
node[shape=record];
replyrequests [label="
๐ซ๐๐ฉ๐ฅ๐ฒ๐ซ๐๐ช๐ฎ๐๐ฌ๐ญ๐ฌ
|
<id>articleId๐\l
|
<user>
userId๐\l
appId๐\l
|
reason\l
|
<timestamps>
createdAt\l
updatedAt\l
|
{
feedbacks\n
(nested)
|
{
score\l
|
userId\l
appId\l
|
createdAt\l
updatedAt\l
}
}
|
positiveFeedbackCount\l
negativeFeedbackCount\l
"]
articlereplyfeedbacks [fixedsize="true" width="3" height="2" label="
๐๐ซ๐ญ๐ข๐๐ฅ๐๐ซ๐๐ฉ๐ฅ๐ฒ๐๐๐๐๐๐๐๐ค๐ฌ
|
<id>articleId๐\l
|
<replyid>replyId๐\l
|
userId๐\l
appId๐\l
|
<score> score\l
|
comment\l
|
createdAt\l
updatedAt\l
"]
articlecategoryfeedbacks [fixedsize="true" width="3" height="2" label="
๐๐ซ๐ญ๐ข๐๐ฅ๐๐๐๐ญ๐๐ ๐จ๐ซ๐ฒ๐๐๐๐๐๐๐๐ค๐ฌ
|
<id>articleId๐\l
|
<categoryid>categoryId๐\l
|
userId๐\l
appId๐\l
|
<score> score\l
|
comment\l
|
createdAt\l
updatedAt\l
"]
replies [label="
<id>๐ซ๐๐ฉ๐ฅ๐ข๐๐ฌ
|
userId\l
appId\l
|
<type>
type\l
|
text\l
|
{
hyperlinks
\n(nested)
|
{
<url>
url\l
|
<title>
title\l
|
<summary>
summary\l
}
}
|
reference\l
|
createdAt\l
"]
articles [label="
<id>
๐๐ซ๐ญ๐ข๐๐ฅ๐๐ฌ
|
<requests>
replyRequestCount\l
lastRequestedAt\l
|
createdAt\l
updatedAt\l
|
text๐\l
|
userId\l
appId\l
|
{
references\n
(nested)
|
{
type\l
permalink\l
createdAt\l
|
userId\l
appId\l
}
}
|
{
articleReplies
\n(nested)
|
{
<reply>
replyId\l
|
<feedbackcounts>
positiveFeedbackCount\l
negativeFeedbackCount\l
|
<replytype>
replyType\l
|
userId\l
appId\l
|
status\l
|
createdAt\l
updatedAt\l
}
}
|
normalArticleReplyCount\l
|
{
articleCategories
\n(nested)
|
{
<category>
categoryId\l
|
<categoryfeedbackcounts>
positiveFeedbackCount\l
negativeFeedbackCount\l
|
aiModel\l
aiConfidence\l
|
userId\l
appId\l
|
status\l
|
createdAt\l
updatedAt\l
}
}
|
normalArticleCategoryCount\l
|
{
hyperlinks
\n(nested)
|
{
<url>
url\l
normalizedUrl\l
|
<title>
title\l
|
<summary>
summary\l
}
}
"]
categories[label="
<id>๐๐๐ญ๐๐ ๐จ๐ซ๐ข๐๐ฌ
|
title\l
|
description\l
|
createdAt\l
updatedAt\l
"]
urls[label="
<id>๐ฎ๐ซ๐ฅ๐ฌ
|
<url>url\l
canonical\l
|
<title>title\l
|
<summary>summary\l
|
html\l
topImageUrl\l
|
fetchedAt\l
status\l
error\l
isReferenced\l
"]
users[label="
<id>๐ฎ๐ฌ๐๐ซ๐ฌ
|
email\l
name\l
avatarUrl\l
|
facebookId\l
githubId\l
twitterId\l
|
createdAt\l
updatedAt\l
"]
cooccurrences[label="
๐๐จ๐จ๐๐๐ฎ๐ซ๐ซ๐๐ง๐๐๐ฌ
|
<id>articleIds ๐\l
|
userId ๐\l
appId ๐\l
|
createdAt\l
updatedAt\l
"]
airesponses[label="
๐๐ข๐ซ๐๐ฌ๐ฉ๐จ๐ง๐ฌ๐๐ฌ
|
<id>docId\l
type\l
|
userId\l
appId\l
|
status\l
text\l
request\l
usage\l
|
createdAt\l
updatedAt\l
"]
articles:id -- replyrequests:id;
articles:requests -- replyrequests:timestamps [style="dotted"];
articles:category -- categories:id;
articles:url -- urls:url;
articles:id -- articlereplyfeedbacks:id;
articles:id -- articlecategoryfeedbacks:id;
articles:reply -- articlereplyfeedbacks:replyid;
articles:category -- articlecategoryfeedbacks:categoryid;
articles:reply -- replies:id;
articles:feedbackcounts -- articlereplyfeedbacks:score [style="dotted"];
articles:categoryfeedbackcounts -- articlecategoryfeedbacks:score [style="dotted"];
articles:replytype -- replies:type [style="dotted"];
articles:title -- urls:title [style="dotted"];
articles:summary -- urls:summary [style="dotted"];
replies:url -- urls:url;
replies:title -- urls:title [style="dotted"];
replies:summary -- urls:summary [style="dotted"];
articles:id -- cooccurrences:id;
articles:id -- airesponses:id;
}
```