-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
irynamcb edited this page Mar 3, 2020
·
16 revisions
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
first_name |
string | not null |
last_name |
string | not null |
email |
string | not null, indexed, unique |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
created_at |
datetime | not null |
updated_at |
datetime | not null |
gender |
string | not null |
birthday |
datetime | not null |
about |
string | |
education |
string | |
location |
string |
- index on
email, unique: true - index on
session_token, unique: true
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
author_id |
integer | not null, indexed, foreign key |
body |
text | not null |
created_at |
datetime | not null |
parent_id |
integer | not null, indexed, foreign key |
-
parent_idis theuser_idof the wall the post is on -
author_idreferencesusers -
parent_idreferencesusers
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
author_id |
integer | not null, indexed, foreign key |
body |
text | not null |
created_at |
datetime | not null |
post_id |
integer | not null, indexed, foreign key |
-
author_idreferencesusers -
post_idreferencesposts
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
author_id |
integer | not null, indexed, foreign key |
likeable_id |
integer | not null, indexed, foreign key |
likeable_type |
string | not null |
created_at |
datetime | not null |
- polymorphic associations,
author_id- a person who create a like -
author_idreferencesusers - references
:likeable, polymorphic: true
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
friend_id |
integer | not null, indexed, foreign key |
-
user_idreferencesusers -
friend_idreferencesusers
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
friend_id |
integer | not null, indexed, foreign key |
-
user_idreferencesusers -
friend_idreferencesusers