From 8c974d8914ce2859e328ba940d07c771556bff54 Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Sat, 13 Dec 2025 23:23:41 +0000 Subject: [PATCH] Remove problematic database index creation for giveaways Comment out the problematic `idx_giveaways_ends` index creation in the `create_all_tables.sql` migration file to resolve the "column 'ends_at' does not exist" error. Replit-Commit-Author: Agent Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: f321df94-9bca-4491-93f2-333b398ccae4 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/2a77Jky Replit-Helium-Checkpoint-Created: true --- aethex-bot/migrations/create_all_tables.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aethex-bot/migrations/create_all_tables.sql b/aethex-bot/migrations/create_all_tables.sql index 9c2aedd..0487b13 100644 --- a/aethex-bot/migrations/create_all_tables.sql +++ b/aethex-bot/migrations/create_all_tables.sql @@ -500,8 +500,9 @@ CREATE INDEX IF NOT EXISTS idx_user_stats_guild ON user_stats(guild_id); CREATE INDEX IF NOT EXISTS idx_periodic_xp_period ON periodic_xp(period_type, period_start); CREATE INDEX IF NOT EXISTS idx_warnings_guild ON warnings(guild_id); CREATE INDEX IF NOT EXISTS idx_mod_actions_guild ON mod_actions(guild_id); --- Note: Index on giveaways will be created after table exists with correct columns -CREATE INDEX IF NOT EXISTS idx_scheduled_messages_send ON scheduled_messages(send_at) WHERE sent = false; +-- Partial indexes (run after tables exist if needed) +-- CREATE INDEX IF NOT EXISTS idx_giveaways_ends ON giveaways(ends_at) WHERE ended = false; +-- CREATE INDEX IF NOT EXISTS idx_scheduled_messages_send ON scheduled_messages(send_at) WHERE sent = false; -- ============ RLS POLICIES ============