Skip to content

Database Schema

Dylan Welzel edited this page Jan 18, 2022 · 3 revisions

Database Schema

Database Diagram

users

column data type details
id integer not null, primary key
name string not null, unique
username string not null, unique
email string not null, unique
hashed_password string not null
profile_picture string not null
status string not null

groups

column data type details
id integer not null, primary key
channel_id integer not null, foreign key
user_id integer not null, foreign key
  • channel_id references channels table
  • user_id references users table

members

column data type details
id integer not null, primary key
org_id integer not null, foreign key
user_id integer not null, foreign key
  • org_id references organizations table
  • user_id references users table

channels

column data type details
id integer not null, primary key
name string not null
org_id integer not null, foreign key
  • org_id references organizations table

organizations

column data type details
id integer not null, primary key
name string not null
owner_id integer not null, foreign key
  • owner_id references users table

direct_messages

column data type details
id integer not null, primary key
content string not null
owner_id integer not null, foreign key
org_id integer not null, foreign key
  • owner_id references users table
  • org_id references organizations table

messages

column data type details
id integer not null, primary key
content string not null
owner_id integer not null, foreign key
channel_id integer not null, foreign key
  • owner_id references users table
  • channel_id references channels table
Clone this wiki locally