Database models

Database models of channel

Channels

channels

The main channel table, this table should only be used when changing things on the channel (not frequently) so we don't add counters or last_activity or anything like that.

{
	//Primary key
	"company_id": "uuid-v4",
	"workspace_id": "string" // ("uuid-v4" | "direct")
	"id": "uuid-v4",
	
	//Content
	"owner": "uuid-v4", //User-id of the channel owner (invisible but used on some access restriction-
	"icon": "String",
	"name": "String",
	"description": "String",
	"channel_group": "String",
	"visibility": "private" | "public" | "direct"
	"default": true | false, //The new members join by default this channel
	"archived": false | true,
	"archivation_date": 0, //Timestamp
}

channel_defaults

Contain the default channels

channel_counters

We use a separated table to manage counters for this channel. Currently this is not used to do statistics but can be used to this goal in the future.

channel_last_activity

Store last channel activity for bold/not bold management

direct_channel_identifiers

This table is used to find an existing discussion with a group of members. The "identifier" is generated from the group of members.

Channels tabs

channel_tabs

Channels can have tabs that are connexion to other apps or different views.

Channels members

channel_members

List of channels for an user

channel_members_reversed

List of users in channel

Not implemented: We need to ensure this replication regularly (on each user open channel) ?

Last updated

Was this helpful?