Database models

Notification database model

channel_members_notification_preferences

{
	//Primary key
	"company_id": "uuid-v4",
	"channel_id": "uuid-v4",
	"user_id": "uuid-v4",

	"preferences": "all" | "mentions" | "me" | "none",
	"last_read": 16000000, //Timestamp in seconds	
}

channel_thread_users

{
	//Primary key
	"company_id": "uuid-v4",
	"channel_id": "uuid-v4",
	"thread_id": "uuid-v4",

	"user_id": "uuid-v4"
}

user_notifications_badges (this is not a counter like scylladb counters here, just classic table)

{
	//Primary key
	"company_id": "uuid-v4", (partition key)
	"user_id": "uuid-v4", (clustering key)
	"workspace_id": "uuid-v4", (clustering key)
	"channel_id": "uuid-v4", (clustering key)
	"thread_id": "uuid-v4", (clustering key)
}

user_notifications_general_preferences

{
	//Primary key
	"company_id": "uuid-v4",
	"user_id": "uuid-v4",
	"workspace_id": "uuid-v4",

	"preferences": PreferencesObject
}

Last updated