schema - GeorgePensiero/atmosphere GitHub Wiki
Users
| column name | datatype | details |
|---|---|---|
| id | integer | not null, pk |
| username | string | not null, indexed |
| password digest | string | not null |
| session token | string | not null, indexed |
index on username and session token(both unique)
stories
| column name | datatype | details |
|---|---|---|
| id | integer | not null, pk |
| title | string | not null |
| body | string | not null |
| author_id | integer | not null, indexed |
index on author_id (foreign key)
Comments
| column name | datatype | details |
|---|---|---|
| id | integer | not null, pk |
| body | string | not null |
| author_id | integer | not null, indexed |
| story_id | integer | not null, indexed |
| parent_comment_id | integer | maybe indexed? |
index on author_id and story_id(foreign keys) parent_comment_id can be null not sure if it needs index
Likes
| column name | datatype | details |
|---|---|---|
| id | integer | not null, pk |
| likeable | references | polymorphic, indexed |
comments and stories will have a polymorphic assoc. with likes as likeable