Repository navigation
Schema
AlbertgitC edited this page Oct 10, 2019
·
7 revisions
| 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, indexed, unique |
| website | string | |
| bio | text | |
| created_at | datetime | not null |
| updated_at | datetime | not null |
- index on
username, unique: true - index on
email, unique: true - index on
session_token, unique: true
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| body | text | |
| author_id | integer | not null, indexed, foreign key |
| created_at | datetime | not null |
| updated_at | datetime | not null |
-
author_idreferencesusers - index on
author_id attached :photo
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| body | text | not null |
| feed_id | integer | not null, indexed, foreign key |
| author_id | integer | not null, foreign key |
| created_at | datetime | not null |
| updated_at | datetime | not null |
-
feed_idreferencesfeeds -
author_idreferencesusers
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| likeable_id | integer | not null, indexed, foreign key |
| likeable_type | string | not null, indexed |
| author_id | integer | not null, foreign key |
| created_at | datetime | not null |
| updated_at | datetime | not null |
- polymorphic table,
likeable_type=feedorcomment -
likeable_idreferencesfeedsorcomments -
author_idreferencesusers - index on
[:likeable_id, :likeable_type, :author_id], unique: true
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| user_id | integer | not null, indexed, foreign key |
| follower_id | integer | not null, indexed, foreign key |
| created_at | datetime | not null |
| updated_at | datetime | not null |
-
user_idreferencesusers -
follower_idreferencesusers