-
Notifications
You must be signed in to change notification settings - Fork 1
Database Schema
tkla edited this page Oct 2, 2021
·
13 revisions
| Column Name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
email |
string | not null, indexed, unique |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
nickname |
string | |
created_at |
datetime | not null |
updated_at |
datetime | not null |
| column name | data types | details |
|---|---|---|
id |
integer | not null, primary key |
name |
string | not null, indexed, unique |
author_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
Servers belong to one User.
| column name | data types | details |
|---|---|---|
id |
integer | not null, primary key |
server_id |
integer | not null, foreign key |
name |
string | not null, unique: server |
author_id |
integer | not null, foreign key |
voice_channel |
boolean | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
Channels belong to servers.
Channels belong to one author.
| column name | data types | details |
|---|---|---|
id |
integer | not null, unique, primary key |
server_id |
integer | not null, indexed, foreign key |
channel_id |
integer | not null, indexed, foreign key |
author_id |
integer | not null, foreign key |
parent_id |
integer | foreign key |
body |
text | not null |
original_body |
text | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
Comments belong to one author.
Comments belong to one parent comment.
Comments have many replies.
| column name | data types | details |
|---|---|---|
id |
integer | not null, unique, primary key |
user_id |
integer | not null, indexed, unique: server, foreign key |
server_id |
integer | not null, indexed, foreign key |
admin |
boolean | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
Users can join many servers.
| column name | data types | details |
|---|---|---|
id |
integer | not null, unique, primary key |
record_id |
integer | not null, foreign key |
blob_id |
integer | not null, foreign key |
record_type |
string | not null, |