chat.sad.ovh/drizzle/0003_wise_lucky_pierre.sql

18 lines
No EOL
592 B
SQL

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`;