diff --git a/aethex-bot/migrations/create_all_tables.sql b/aethex-bot/migrations/create_all_tables.sql index 0487b13..8ade09c 100644 --- a/aethex-bot/migrations/create_all_tables.sql +++ b/aethex-bot/migrations/create_all_tables.sql @@ -442,11 +442,19 @@ CREATE TABLE IF NOT EXISTS command_logs ( CREATE TABLE IF NOT EXISTS server_backups ( id SERIAL PRIMARY KEY, guild_id VARCHAR(32) NOT NULL, + name VARCHAR(100), + description TEXT, + backup_type VARCHAR(20) DEFAULT 'manual', -- manual, auto backup_data JSONB NOT NULL, + roles_count INTEGER DEFAULT 0, + channels_count INTEGER DEFAULT 0, + size_bytes BIGINT DEFAULT 0, created_by VARCHAR(32), created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); +CREATE INDEX IF NOT EXISTS idx_server_backups_guild ON server_backups(guild_id); + -- Backup Settings - Auto-backup config CREATE TABLE IF NOT EXISTS backup_settings ( id SERIAL PRIMARY KEY, diff --git a/aethex-bot/migrations/fix_server_backups.sql b/aethex-bot/migrations/fix_server_backups.sql new file mode 100644 index 0000000..5760eed --- /dev/null +++ b/aethex-bot/migrations/fix_server_backups.sql @@ -0,0 +1,11 @@ +-- Fix server_backups table - add missing columns +-- Run this if you already created the table with the old schema + +ALTER TABLE server_backups ADD COLUMN IF NOT EXISTS name VARCHAR(100); +ALTER TABLE server_backups ADD COLUMN IF NOT EXISTS description TEXT; +ALTER TABLE server_backups ADD COLUMN IF NOT EXISTS backup_type VARCHAR(20) DEFAULT 'manual'; +ALTER TABLE server_backups ADD COLUMN IF NOT EXISTS roles_count INTEGER DEFAULT 0; +ALTER TABLE server_backups ADD COLUMN IF NOT EXISTS channels_count INTEGER DEFAULT 0; +ALTER TABLE server_backups ADD COLUMN IF NOT EXISTS size_bytes BIGINT DEFAULT 0; + +CREATE INDEX IF NOT EXISTS idx_server_backups_guild ON server_backups(guild_id); diff --git a/aethex-bot/public/dashboard.html b/aethex-bot/public/dashboard.html index 46db529..e3bd66e 100644 --- a/aethex-bot/public/dashboard.html +++ b/aethex-bot/public/dashboard.html @@ -8,6 +8,9 @@ + + +