-
Notifications
You must be signed in to change notification settings - Fork 10
Schema
Elliott Grieco edited this page Nov 2, 2017
·
11 revisions
| key | type | note |
|---|---|---|
id |
integer | pk, not null |
email |
string | not null, unique, indexed |
first_name |
string | not null |
last_name |
string | |
img_url |
string | not null |
password_digest |
integer | not null |
session_token |
integer | not null, unique, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
Example feed metadata:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<atom:link href="http://www.politico.com/congress" rel="self" type="application/rss+xml"/>
<title>Congress</title>
<link>http://www.politico.com/congress</link>
<description>News, Analysis and Opinion from POLITICO</description>
<language>en-us</language>
<copyright>2017 POLITICO</copyright>
<pubDate>Thu, 19 Oct 2017 03:28:51 GMT</pubDate>
| key | type | note |
|---|---|---|
id |
integer | pk, not null |
title |
string | not null |
rss_url |
string | not null, unique |
description |
string | not null |
img_url |
string | not null |
favicon_url |
string | not null |
website_url |
string | not null |
last_publish |
timestamp | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
Example story metadata:
<item>
<title>Senate staffers interview Lewandowski in Russia probe</title>
<link>http://www.politico.com/story/2017/10/18/corey-lewandowski-senate-russia-investigation-243920</link>
<description/>
<pubDate>Wed, 18 Oct 2017 20:56:54 GMT</pubDate>
<author>eschor@politico.com (Elana Schor)</author>
<guid isPermaLink="true">http://www.politico.com/story/2017/10/18/corey-lewandowski-senate-russia-investigation-243920</guid>
</item>
| key | type | note |
|---|---|---|
id |
integer | pk, not null |
title |
string | not null |
author |
string | not null |
description |
string | not null |
summary |
string | not null |
link_url |
string | not null |
img_url |
string | not null |
feed_id |
integer | not null, fk |
pub_date |
datetime | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
feed_idreferencesfeeds
| key | type | note |
|---|---|---|
id |
integer | pk, not null |
subscriber_id |
integer | fk, indexed not null |
feed_id |
integer | fk, indexed not null |
title |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
subscriber_idreferencesusers -
feed_idreferencesfeeds - index on
[:subscriber_id, :feed_id], unique: true
| key | type | note |
|---|---|---|
id |
integer | pk, not null |
name |
string | not null |
creator_id |
integer | fk, indexed not null |
-
creator_idreferencesusers - index on
[:name, :creator_id] unique: true
| key | type | note |
|---|---|---|
subscription_id |
integer | fk, indexed not null |
collection_id |
integer | fk, indexed not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
subscription_idreferencessubscriptions -
collection_idreferencescollections -
subscriptionswithoutcollection_assignmentsare destroyed
| key | type | note |
|---|---|---|
| id | integer | required |
| read | boolean | not null |
| reader_id | integer | fk, not null |
| story_id | integer | fk, not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
reader_idreferencesusers -
story_idreferencesstories - index on
[:reader_id, :story_id], unique: true
(unique user/story pair)
| key | type | note |
|---|---|---|
| id | integer | required |
| user_id | integer | fk: User (required) |
| story_id | integer | fk: Story (required) |
| key | type | note |
|---|---|---|
| id | integer | required |
| name | string | required, unique |