Add guild_member_stats table and update permissions for Discord members

- Created a new table `guild_member_stats` to track message counts and voice activity for users in each guild.
- Updated the database schema and models to include the new table.
- Added a new permission entry for `discord_members` in the `webapp_page_permission` table.
- Enhanced the webapp to include links and settings for managing Discord member statistics.
This commit is contained in:
2026-03-25 22:52:32 +01:00
parent bb92c3dd92
commit 855c13c183
10 changed files with 535 additions and 2 deletions
+9
View File
@@ -99,6 +99,15 @@ CREATE TABLE IF NOT EXISTS `member_invites` (
`join_date` DATETIME NOT NULL
);
CREATE TABLE IF NOT EXISTS `guild_member_stats` (
`guild_id` VARCHAR(64) NOT NULL,
`user_id` VARCHAR(64) NOT NULL,
`message_count` INTEGER NOT NULL DEFAULT 0,
`voice_seconds` INTEGER NOT NULL DEFAULT 0,
`updated_at` DATETIME,
PRIMARY KEY (`guild_id`, `user_id`)
);
CREATE TABLE IF NOT EXISTS `twitch_link_filter` (
id INTEGER PRIMARY KEY AUTOINCREMENT,
`enabled` BOOLEAN NOT NULL DEFAULT FALSE,