38980-vm/app-9w9pd00g5j41/supabase/migrations/00049_update_rate_limit_rules.sql
2026-03-04 18:25:09 +00:00

13 lines
651 B
SQL

-- Add missing rate limit rules and update names
INSERT INTO rate_limit_rules (endpoint, max_requests, window_seconds) VALUES
('add_place', 50, 3600), -- 50 places per hour
('search', 100, 3600), -- 100 searches per hour
('export_pdf', 5, 86400), -- 5 PDF exports per day
('ai_suggestion', 30, 3600) -- 30 AI suggestions per hour
ON CONFLICT (endpoint) DO UPDATE SET
max_requests = EXCLUDED.max_requests,
window_seconds = EXCLUDED.window_seconds;
-- Optionally rename export_data to export_pdf if it exists and we want to keep logs
-- But since we are inserting export_pdf, we can just leave it.