diff --git a/migrations/20260511132221_creation.sql b/migrations/20260511132221_creation.sql index 63c3253..0f8b79a 100644 --- a/migrations/20260511132221_creation.sql +++ b/migrations/20260511132221_creation.sql @@ -9,7 +9,8 @@ create TABLE `User` ( create TABLE `Channel` ( `id` INT UNSIGNED NOT NULL PRIMARY KEY, - `guild_id` INT UNSIGNED NOT NULL + `guild_id` INT UNSIGNED NOT NULL, + FOREIGN KEY(guild_id) REFERENCES Guild(id) ); create TABLE `Logs` ( @@ -20,10 +21,13 @@ create TABLE `Logs` ( `message_update` BOOLEAN DEFAULT FALSE, `message_delete` BOOLEAN DEFAULT FALSE, `voice_join` BOOLEAN DEFAULT FALSE, - `voice_quit` BOOLEAN DEFAULT FALSE + `voice_quit` BOOLEAN DEFAULT FALSE, + FOREIGN KEY(guild_id) REFERENCES Guild(id), + FOREIGN KEY(channel_id) REFERENCES Channel(id) ); create TABLE `Auto_Channel` ( `channel_id` INT UNSIGNED NOT NULL PRIMARY KEY, - `category_id` INT UNSIGNED + `category_id` INT UNSIGNED, + FOREIGN KEY(channel_id) REFERENCES User(id) )