Vollständige Next.js 15 Portfolio-Website mit: - Blog-System mit 100+ Artikeln - Supabase-Integration - Responsive Design mit Tailwind CSS - TypeScript-Konfiguration - Testing-Setup mit Vitest und Playwright Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.9 KiB
How to Apply the Rate Limits Migration
Quick Start (Manual Application)
Since the Supabase CLI is not configured for this project, please follow these steps to apply the migration manually through the Supabase dashboard:
Step 1: Access the SQL Editor
Open the Supabase SQL Editor in your browser:
https://app.supabase.com/project/mxadgucxhmstlzsbgmoz/sql
Step 2: Copy the Migration SQL
Open the migration file:
supabase/migrations/20260125_create_rate_limits_table.sql
Copy the entire contents (approximately 42 lines of SQL).
Step 3: Execute the Migration
- In the SQL Editor, paste the copied SQL
- Click the "RUN" button (or press
Ctrl+Enter/Cmd+Enter) - Wait for the success message: "Success. No rows returned"
Step 4: Verify the Table Was Created
Option A: Using Table Editor
- Navigate to: https://app.supabase.com/project/mxadgucxhmstlzsbgmoz/editor
- Look for "rate_limits" in the table list (left sidebar)
- Click on it to see the table structure
Option B: Using SQL Query Run this query in the SQL Editor:
SELECT
table_name,
column_name,
data_type,
is_nullable
FROM information_schema.columns
WHERE table_name = 'rate_limits'
ORDER BY ordinal_position;
You should see 5 rows (one for each column):
- identifier (text)
- count (integer)
- window_start (timestamp with time zone)
- created_at (timestamp with time zone)
- updated_at (timestamp with time zone)
Option C: Check Indexes Run this query to verify indexes were created:
SELECT
indexname,
indexdef
FROM pg_indexes
WHERE tablename = 'rate_limits';
You should see:
- Primary key on (identifier, window_start)
- idx_rate_limits_identifier_window
- idx_rate_limits_window_start
Troubleshooting
Error: "relation 'rate_limits' already exists"
The table is already created! No action needed. Verify it exists using the verification steps above.
Error: "permission denied"
Make sure you're:
- Logged into the correct Supabase account
- Have admin/owner permissions on the project
- Using the correct project URL
Table not visible in Table Editor
- Refresh the page (F5)
- Check the SQL output for error messages
- Try the SQL verification query in Option B above
Need to Revert/Drop the Table?
If you need to start over, run this SQL:
DROP TABLE IF EXISTS rate_limits CASCADE;
Then re-apply the migration from Step 1.
Alternative: Automated Scripts
We've provided scripts for automated migration, but they require additional setup:
Using apply-migration.js (requires service role key)
- Add
SUPABASE_SERVICE_ROLE_KEYto.env.local - Run:
node scripts/apply-migration.js
Using Supabase CLI (if installed)
supabase migration up
Next Steps
After the migration is applied successfully:
- ✅ Verify the table exists (see Step 4 above)
- ✅ Mark this subtask as complete
- ✅ Proceed to Phase 2: Building the rate limiting utility