Schema - solracdelsol/Distro GitHub Wiki
Postgres DB Schema
Users
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
username |
string | not null, unique, indexed, foreign key |
email |
string | not null, unique, indexed |
password_digest |
string | not null |
created_at |
datetime | |
updated_at |
datetime |
Friends
column name | data type | details |
---|---|---|
user_id | integer | indexed, foreign key |
friend_id | integer | indexed, foreign key |
Server
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
server_title | string | not null |
host_id | integer | not null, unique, indexed, foreign key |
Channel
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
channel_title | string | not null |
server_id | integer | not null, unique, indexed, foreign key |
Chat
column name | data type | details |
---|---|---|
chat_id | integer | not null, indexed |
participant_id | integer | not null, indexed(UNECESSARY IDX?) |
Message
column name | data type | details |
---|---|---|
body | string | not null |
author_id | integer | not null, indexed??? |
timestamp | integer | not null |