Repository navigation
Database Schema
Renerose Dimatulac edited this page May 21, 2021
·
3 revisions

| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
firstname |
string(50) | not null |
lastname |
string(50) | not null |
email |
string(50) | not null, unique |
hashed_password |
string binary | not null |
avatar |
string(360) | |
bio |
text | |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- A
userhasManymessages - A
userhasManychannels
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
name |
string(25) | not null, unique |
channel_type |
string(10) | not null, default to public |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- channel_type = public, private, or dm
- A
channelhasManyusers - A
channelhasManymessages
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, foreign key |
channel_id |
integer | not null, foreign key |
body |
text | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_idreferencesusers(id) -
channel_idreferenceschannels(id) - A
messagebelongsTo auser - A
messagebelongsTo achannel
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, foreign key |
channel_id |
integer | not null, foreign key |
is_starred |
boolean | not null, default to false |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_idreferencesusers(id) -
channel_idreferenceschannels(id)