Database Schema
All columns are NOT NULL unless explicitly defined otherwise.

Common columns
All tables will have the following columns.
created_at
timestamp with timezone
UTC timestamp of the creation datetime
created_by
varchar(255)
updated_at
timestamp with timezone
UTC timestamp of the update datetime
updated_by
varchar(255)
organization
All accounts and applications belong to a single organization. An example of an organization is a company such as FunGames.
id
bigserial
Auto-increment primary key
name
varchar(255)
account
An account is created for every user, such as a developer working for FooGames. It's used to sign in to the dashboard.
id
bigserial
Auto-increment primary key
varchar(255)
password
text
PBKDF2-SHA256 salted password
first_name
varchar(255)
last_name
varchar(255)
organization_id
bigint
application
An application is a service run by the customer, such as FooRacing, developed by FooGames.
id
bigserial
Auto-increment primary key
name
varchar(255)
organization_id
bigint
user
The user is created within an application to be the writer of messages. One example would be a gamer playing the game FooRacing.
id
bigserial
Auto-increment primary key
application_id
bigint
username
varchar(255)
Must be unique within an application.
nickname
varchar(255)
User defined nick name.
channel
A channel is equivalent to a chat room.
id
bigserial
Auto-increment primary key
uuid
UUID
Randomly generated UUID. Used for identifying a channel publicly. Must be a unique value.
application_id
bigint
name
varchar(255)
max_members
int
Max number of users that can join the channel.
channel_users
Status of which users are joined in which channels.
id
bigserial
Auto-increment primary key
user_id
bigint
channel_id
bigint
message
id
bigserial
Auto-increment primary key
user_id
bigint
channel_id
bigint
message
varchar(3000)
Last updated