-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
saphknight edited this page Mar 21, 2019
·
10 revisions
column name | data type | details |
---|---|---|
id |
integer |
not null, primary key |
username |
string |
not null |
user_image_url |
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 |
- index on
email, unique: true
- index on
session_token, unique: true
column name | data type | details |
---|---|---|
id |
integer |
not null, primary key |
name |
string |
not null |
url |
string |
not null, indexed, unique |
created_at |
datetime |
not null |
updated_at |
datetime |
not null |
- index on
url, unique: true
column name | data type | details |
---|---|---|
id |
integer |
not null, primary key |
name |
string |
not null |
description |
string |
not null |
direct_message? |
boolean |
not null |
workspace_id |
integer |
not null, indexed, foreign key |
created_at |
datetime |
not null |
updated_at |
datetime |
not null |
-
workspace_id
referencesworkspaces
- index on
workspace_id
column name | data type | details |
---|---|---|
id |
integer |
not null, primary key |
body |
string |
not null |
channel_id |
integer |
not null, indexed, foreign key |
user_id |
integer |
not null, indexed, foreign key |
created_at |
datetime |
not null |
updated_at |
datetime |
not null |
-
channel_id
referenceschannels
-
user_id
referencesusers
- index on
channel_id
- index on
user_id
column name | data type | details |
---|---|---|
id |
integer |
not null, primary key |
user_id |
integer |
not null, indexed, foreign key |
workspace_id |
integer |
not null, indexed, foreign key |
created_at |
datetime |
not null |
updated_at |
datetime |
not null |
-
user_id
referencesusers
-
workspace_id
referencesworkspaces
- index on
[:user_id, :workspace_id], unique: true
- index on
user_id
- index on
workspace_id
column name | data type | details |
---|---|---|
id |
integer |
not null, primary key |
user_id |
integer |
not null, indexed, foreign key |
channel_id |
integer |
not null, indexed |
created_at |
datetime |
not null |
updated_at |
datetime |
not null |
-
user_id
referencesusers
-
channel_id
referenceschannels
- index on
[:user_id, :channel_id], unique: true
- index on
user_id
- index on
channel_id