add foreign ref to database

This commit is contained in:
2026-05-11 21:26:24 +02:00
parent fee9cf488f
commit 93c57f69df
+7 -3
View File
@@ -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)
)