Skip to content

Database Spec

Ghom edited this page Nov 30, 2020 · 4 revisions

Database Specs

Using PostgreSQL, some elements are recursives and identifiants are auto generated uuid v4.

Sizings

  • fat: 2048
  • big: 1024
  • medium: 64
  • little: 16
  • tiny: 8

Extensions

uuid_generate_v4()

Tables

message

Message sent in channel (real markdown allowed)

  • id uuid (auto generated)
  • parent ref: message or null
  • content String (fat)
  • author ref: user or bot
  • channel ref: mhannel
  • guild ref: guild
  • created_at Datetime

embed

A grid

  • id uuid (auto generated)
  • message ref: message
  • rows Integer default: 1
  • cols Integer default: 1
  • width Integer # pixel width of full grid
  • height Integer # pixel height of full grid

embed_component

A component to place on embed grid

  • embed ref: embed
  • content String or null (big) # URL for image, gif or video, text for content
  • rows Integer default: 1
  • cols Integer default: 1
  • x Integer
  • y Integer

channel

Channel in guild

  • id uuid (auto generated)
  • parent ref: channel or null
  • name String (medium)
  • guild ref: guild
  • position Integer
  • network ref: network
  • created_at Datetime

network

Link between channels of different guilds

  • id uuid (auto generated)
  • name String (medium)
  • password String (medium)
  • icon String (medium)
  • description (fat)
  • owner ref: user or bot
  • created_at Datetime

guild

Guild like Discord Guilds

  • id uuid (auto generated)
  • name String (medium)
  • icon String (big)
  • owner ref: user or bot
  • hash String (medium) # code présent dans l'URL d'invitation
  • created_at Datetime

user

User account

  • id uuid (auto generated)
  • token String (big)
  • bot FALSE
  • username String (medium)
  • password String (medium)
  • created_at Datetime

bot

Bot account (created by an user)

  • id uuid (auto generated)
  • token String (big)
  • bot TRUE
  • owner ref: user
  • created_at Datetime

member

Member of a guild

  • id uuid (auto generated)
  • guild ref: guild
  • user ref: user or bot
  • nickname String (medium)
  • created_at Datetime

role

Role of a member

  • id uuid (auto generated)
  • parent ref: role or null
  • name String (medium)
  • user ref: user or bot
  • guild ref: guild
  • color: String (little)
  • created_at Datetime

guild_positition

Client position of a guild for an user

  • guild ref: guild
  • user ref: user
  • position Integer
Clone this wiki locally