Skip to content
Elliott Grieco edited this page Nov 2, 2017 · 11 revisions

MVPs

user:

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

feed

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

story

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_id references feeds

subscription

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_id references users
  • feed_id references feeds
  • index on [:subscriber_id, :feed_id], unique: true

collection

key type note
id integer pk, not null
name string not null
creator_id integer fk, indexed not null
  • creator_id references users
  • index on [:name, :creator_id] unique: true

collection_assignment

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_id references subscriptions
  • collection_id references collections
  • subscriptions without collection_assignments are destroyed

read_status

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_id references users
  • story_id references stories
  • index on [:reader_id, :story_id], unique: true

Potential bonus schema features:

favorite

(unique user/story pair)

key type note
id integer required
user_id integer fk: User (required)
story_id integer fk: Story (required)

topic

key type note
id integer required
name string required, unique

Clone this wiki locally