Commit graph

4 commits

Author SHA1 Message Date
Jason Rhinelander
1e8203f76e Database redesign and code associated refactor 2021-10-11 20:23:45 -03:00
Jason Rhinelander
96f979d2ac Rename identifier -> token, make case insensitive, add constraint 2021-10-11 20:23:45 -03:00
Jason Rhinelander
b5fcac5e48 Apply arrived-at future user permissions 2021-10-11 20:23:45 -03:00
Jason Rhinelander
ace493f643 Initial DB redesign
Completely overhauls the underlying database design:

- referential integrity
- data normalization
- using triggers for various updates to reduce the amount of data logic
  in code.
- indexes
- one single database rather than 1 + 1/room
- various structural improvements for useful features such as:
    - individually and default-assignable read/write/upload
    - time-based permission expiries (e.g. restrict this permission for
      x amount of time)
    - distinguishing between admins (who can add/remove moderators) and
      moderators (who can only moderate but not control the moderator
      list)
    - global server moderators/admins
    - global server bans
    - single VIEW for simple querying of a user's effective permissions
      (i.e. with database-side coalescing of global/local permissions).
    - pinned message via foreign key
    - room icon as a regular uploaded file
    - per-file file expiries (so that admins/mods can upload non-expiry
      files, such as the room icon, or pinned downloads).
    - message history so that when messages get edited or deleted a log
      is kept of the old value (the idea being that mods would be able
      to look this up).
    - movable messages (e.g. so there could be a "bad posts" room that
      only moderators have access to).
2021-10-11 20:23:43 -03:00