-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
Jamie An edited this page Nov 24, 2021
·
8 revisions
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
username |
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 |
- index on
username, unique: true - index on
session_token, unique: true
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
title |
string | not null |
body |
text | |
media |
string | |
link |
string | |
poster_id |
integer | not null, indexed |
community_id |
integer | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
poster_id - index on
community_id -
poster_idis a reference to an id in theuserstable -
community_idis a reference to an id in thecommunitiestable
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
content |
text | not null |
commenter_id |
integer | not null, indexed |
post_id |
integer | not null, indexed |
parent_comment_id |
integer | indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
commenter_id - index on
post_id - index on
parent_comment_id -
commenter_idis a reference to an id in theuserstable -
post_idis a reference to an id in thepoststable -
parent_comment_idis a reference to an id in thecommentstable
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
vote |
boolean | not null |
user_id |
integer | not null, indexed |
parent_id |
integer | not null, indexed |
parent_type |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
user_id - index on
parent_id -
user_idis a reference to an id in theuserstable -
parent_idis a reference to an id in either thepostsorcommentstable- determined by the
parent_type
- determined by the
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed |
parent_id |
integer | not null, indexed |
parent_type |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
user_id - index on
parent_id -
user_idis a reference to an id in theuserstable -
parent_idis a reference to an id in either thepostsorcommentstable- determined by the
parent_type
- determined by the
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed |
community_id |
integer | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
user_id - index on
community_id -
user_idis a reference to an id in theuserstable -
communities_idis a reference to an id in thecommunitiestable
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
sub |
string | not null, indexed, unique |
about |
text | not null |
creator_id |
integer | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
sub, unique: true - index on
creator_id -
creator_idis a reference to an id in theuserstable