-
Notifications
You must be signed in to change notification settings - Fork 9
Schema
Stephen Pangburn edited this page Sep 8, 2017
·
1 revision
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
username | string | not null, indexed, unique |
string | not null, indexed, unique | |
password_digest | string | not null |
session_token | string | not null |
has_many :stories, :comments, :likes, :follows, :followers
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
title | string | not null |
body | text | not null |
author_id | integer | not null, foreign key (references users), indexed |
image_url | string |
belongs_to :author, has_many :likes, :comments
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
body | text | not null |
author_id | integer | not null, foreign key (references users), indexed |
story_id | integer | not null, foreign key (references posts), indexed |
belongs_to :author, :post
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
follower_id | integer | not null, foreign key (references users), indexed |
followee_id | integer | not null, foreign key (references users), indexed |
belongs_to :follower, :followee
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
user_id | integer | not null, foreign key (references users), indexed |
story_id | integer | not null, foreign key (references users), indexed |
belongs_to :user, :post