-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
Snigdha Banda edited this page Oct 28, 2021
·
12 revisions
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
email |
string | not null, indexed, unique |
image_url |
string | not null |
display_name |
string | not null, indexed |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
email, unique: true - index on
display_name
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
body |
text | not null |
parent_message_id |
integer | foreign key |
author_id |
integer | not null, indexed, foreign key |
channel_id |
integer | indexed, foreign key |
dm_id |
integer | indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
parent_message_idis a foreign-key that self-references id -
author_idreferences the author of the message -
channel_idreferences the channel the messages belong to -
dm_idreferences the direct message or group message for the message
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
name |
string | indexed, unique, not null |
topic |
string | |
description |
string | |
creator_id |
integer | not null, foreign key |
member_id |
integer | not null, foreign key, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
creator_idreferences users who created the channel and can rename or delete a channel -
member_idreferences users in the channel without the above permissions
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
member_id |
integer | not null, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
member_idreferences users (2 or more) in the channel who can message back and forth
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
image_url |
string | not null |
message_id |
integer | foreign key, not null |
reactor_id |
integer | foreign_key, not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
reactor_idreferences users who reacted to that message -
message_idreferences the message with emojis