add group, server and friends to db

This commit is contained in:
Soph :3 2026-01-04 14:45:15 +02:00
parent 91284c242a
commit 37ae49b66e
6 changed files with 426 additions and 8 deletions

View file

@ -0,0 +1,18 @@
CREATE TABLE `group` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`owner` text NOT NULL,
`members` text DEFAULT '[]' NOT NULL,
FOREIGN KEY (`owner`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `server` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`owner` text NOT NULL,
`members` text DEFAULT '[]' NOT NULL,
`channels` text DEFAULT '[]' NOT NULL,
FOREIGN KEY (`owner`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
ALTER TABLE `user` DROP COLUMN `age`;