feat: add stuff for categories

The get and post methods currently are just copies of the channel ones
This commit is contained in:
Radical 2025-07-12 19:44:49 +02:00
parent b7b07141f9
commit 45bca0bd20
7 changed files with 488 additions and 0 deletions

View file

@ -0,0 +1,4 @@
-- This file should undo anything in `up.sql`
ALTER TABLE channels DROP COLUMN in_category;
DROP TABLE categories;

View file

@ -0,0 +1,10 @@
-- Your SQL goes here
CREATE TABLE categories (
uuid UUID PRIMARY KEY NOT NULL,
guild_uuid UUID NOT NULL REFERENCES guilds(uuid),
name VARCHAR(32) NOT NULL,
description VARCHAR(500) DEFAULT NULL,
is_above UUID UNIQUE REFERENCES categories(uuid) DEFAULT NULL
);
ALTER TABLE channels ADD COLUMN in_category UUID REFERENCES categories(uuid) DEFAULT NULL;