feat: add a channel as a logging channel

Closes #1, fixes #10
This commit is contained in:
2023-11-23 02:09:45 +01:00
parent 47dd2b02c4
commit c7bf7ec9e6
7 changed files with 114 additions and 73 deletions

View File

@@ -1,6 +1,13 @@
-- Add migration script here
-- Discord IDs are kept as INTEGERs and not unsigned INTEGERs despite
-- their Rust type being u64. In order to properly manage them, you'll
-- need to cast any u64 to i64 with `as i64` before writing them to
-- the database, and cast any i64 to u64 with `as u64` when reading
-- them from the database. This operation is noop in Rust and should
-- therefore not cost a single CPU cycle.
CREATE TABLE IF NOT EXISTS guild_log_channels (
guild_id TEXT PRIMARY KEY,
channel_id TEXT NOT NULL,
guild_id INTEGER PRIMARY KEY,
channel_id INTEGER NOT NULL,
UNIQUE(guild_id, channel_id)
);