Skip to content

Instantly share code, notes, and snippets.

@buley
Created October 9, 2011 04:44
Show Gist options
  • Save buley/1273310 to your computer and use it in GitHub Desktop.
Save buley/1273310 to your computer and use it in GitHub Desktop.
Database Schema
###
#
# Accounts
#
##
note over Accounts: id* (int) [auto]
note over Accounts: user_id (string)
note over Accounts: user_name (string)
note over Accounts: reporter_id (string)
Reporters->Accounts: id*->reporter_id
note over Accounts: publisher_id (string)
Publishers->Accounts: id*->publisher_id
note over Accounts: type (string)
note over Accounts: icon (string)
Media->Accounts: id*->media_id
###
#
# Reporters
#
##
note over Reporters: id* (string) [auto]
note over Reporters: display (string)
note over Reporters: display_alternates (array of strings)
note over Reporters: subscriptions (array of strings)
Sources->Reporters: id*->source_id
note over Reporters: twitter_id (string)
Accounts->Reporters: id*->twitter_id
note over Reporters: facebook_id (string)
Accounts->Reporters: id*->facebook_id
note over Reporters: type (string)
###
#
# Activities
#
##
note over Activities: id* (int) [auto]
note over Activities: type (string)
note over Activities: title (string)
note over Activities: description (string)
note over Activities: reporter_id (string)
Reporters->Activities: id*->reporter_id
note over Activities: publisher_id (string)
Reporters->Activities: id*->publisher_id
note over Activities: service_id (string)
Services->Activities: id*->service_id
note over Activities: source_ids (array of strings)
Sources->Activities: id*->source_id
note over Activities: media_ids (array of strings)
Media->Activities: id*->media_id
note over Activities: notebook_ids (array of strings)
Notebooks->Activities: id*->notebook_id
note over Activities: entity_ids (array of strings)
Entities->Activities: id*->entity_id
note over Activities: public (bool)
note over Activities: visible (bool)
note over Activities: published (int) [timestamp]
note over Activities: modified (int) [timestamp]
note over Activities: reply_to (string)
Activities->Activities: id*->reply_to_id
note over Activities: trash_ids (array of strings)
Activities->Activities: id*->trash_id
note over Activities: archive_ids (array of strings)
Activities->Activities: id*->archive_id
note over Activities: read_ids (array of strings)
Activities->Activities: id*->read_id
note over Activities: seen_ids (array of strings)
Activities->Activities: id*->seen_id
note over Activities: vote_ids (array of strings)
Activities->Activities: id*->vote_id
###
#
# Media
#
##
note over Media: id* (int) [auto]
note over Media: type (string)
note over Media: uri (string)
note over Media: height (int)
note over Media: height_unit (string)
note over Media: width (int)
note over Media: width_unit (string)
note over Media: duration (int)
note over Media: duration_unit (string)
note over Media: source_uri (string)
note over Media: source_text (string)
note over Media: source_type (string)
###
#
# Notebooks
#
##
note over Notebooks: id* (string)
note over Notebooks: name (string)
note over Notebooks: type (string)
note over Notebooks: description (string)
note over Notebooks: public (bool)
note over Notebooks: backup (bool)
###
#
# Stories
#
##
note over Stories: id* (string)
note over Stories: type (string)
note over Stories: uri (string)
note over Stories: title (string)
note over Stories: description (string)
note over Stories: media_ids (array of strings)
Media->Stories: id*->media_id
note over Stories: activity_ids (array of strings)
Activity->Stories: id*->activity_id
###
#
# Drafts
#
##
note over Drafts: id* (string)
note over Drafts: reporter_id (string)
Reporters->Drafts: id*->reporter_id
note over Drafts: uri (string)
note over Drafts: title (string)
note over Drafts: description (string)
note over Drafts: media_ids (array of strings)
Media->Drafts: id*->media_id
note over Drafts: activity_ids (array of strings)
Activity->Drafts: id*->activity_id
###
#
# Publishers
#
##
note over Publishers: id* (int) [auto]
note over Publishers: display (string)
note over Publishers: display_alternates (array of strings)
note over Publishers: domains (array of strings)
Entities->Publishers: id*->entity_id
note over Publishers: twitter_id (string)
Accounts->Publishers: id*->twitter_id
note over Publishers: facebook_id (string)
Accounts->Publishers: id*->facebook_id
note over Publishers: type (string)
note over Publishers: subscriptions (array of strings)
Reporters->Publishers: id*->reporter_id
###
#
# Services
#
##
note over Services: id* (int) [auto]
note over Services: display (string)
note over Services: type (string)
note over Services: uri (string)
note over Services: logo (array of strings)
Media->Services: id*->media_id
###
#
# Sources
#
##
note over Sources: id* (int) [auto]
note over Sources: display (string)
note over Sources: type (string)
note over Sources: uri (string)
note over Sources: updated (int) [timestamp]
note over Sources: checked (int) [timestamp]
note over Sources: logo (array of strings)
Media->Services: id*->media_id
##
#
# Interfaces
#
##
note over Interfaces: id* (int) [unique, inc]
note over Interfaces: type (string)
note over Interfaces: name (string)
note over Interfaces: description (string)
note over Interfaces: public (bool)
note over Interfaces: backup (bool)
###
#
# Metrics
#
##
note over Metrics: id* (int) [unique, inc]
note over Metrics: type (string)
note over Metrics: to (int) [timestamp]
note over Metrics: from (int) [timestamp]
note over Metrics: strength (int)
note over Metrics: votes (int)
note over Metrics: value (object)
###
#
# Connections
#
##
note over Connections: id* (int) [unique, inc]
note over Connections: type (string)
note over Connections: to (string)
Entities->Connections:id*->to_id
note over Connections: from (string)
Entities->Connections:id*->from_id
note over Connections: strength (int)
note over Connections: votes (int)
Activities->Connections:id*->vote_id
note over Connections: payload (object)
###
#
# Entities
#
##
note over Entities: id* (int) [unique, inc]
note over Entities: display (string)
note over Entities: display_alternates (array of strings)
note over Entities: type (string)
note over Entities: slug (string) [unique]
note over Entities: parents (array of strings)
Entities->Entities: id*->parent_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment