Production Deployment Checklist
Pre-Deployment
- Staging is working correctly
- All migrations tested on staging
- Code committed to git
- Backup production database (optional but recommended)
Deployment Steps
1. Commit Your Changes
# Review what will be committed
git status
# Add relevant files (exclude .env files)
git add scripts/deploy-to-production.sh
git add scripts/deploy-to-staging.sh
git add src/hooks/useMenuCategories.tsx
git add src/hooks/useUnifiedDishes.tsx
# Add any other code changes
# Commit
git commit -m "Deploy: Fix menu filtering and migration deployment scripts"
# Push to remote
git push
2. Run Production Deployment
./scripts/deploy-to-production.sh
The script will:
- Link to production
- Attempt to push migrations
- If migration history mismatch occurs, it will offer to generate cleanup SQL
3. Handle Migration History Mismatch (if needed)
If you see "Remote migration versions not found" error:
Option A: Generate and run cleanup SQL (Recommended)
- Choose option 1 when prompted
- Review the generated SQL file:
scripts/delete-production-migrations-generated.sql - Go to: https://supabase.com/dashboard/project/zvyvpucxdnftgrixxrxy/sql
- Switch to 'postgres' role (top-right dropdown)
- Run the SELECT query first to preview what will be deleted
- Uncomment and run the DELETE statement
- Retry the deployment script
Option B: Continue without fixing (migrations will still apply)
- Choose option 2 when prompted
- Migrations will be applied but you may see errors
- You can fix history later
4. Verify Deployment
After migrations are pushed:
-
Check Supabase Dashboard:
- Go to: https://supabase.com/dashboard/project/zvyvpucxdnftgrixxrxy
- Check Database → Migrations to see applied migrations
- Check Logs for any errors
-
Test Application:
- Test critical features
- Verify Menu Overview page filters correctly
- Check for console errors
- Test RLS policies
-
Monitor:
- Watch error logs for 24-48 hours
- Monitor user feedback
- Check application performance
Troubleshooting
Migration History Mismatch
Symptom: Remote migration versions not found in local migrations directory
Solution: Use the SQL cleanup approach (see step 3 above)
RLS Policies Not Working
Symptom: 403 Forbidden errors or data not filtering correctly
Solution:
- Check if RLS is enabled on tables
- Verify policies are correct
- Check user roles and permissions
Migrations Not Applying
Symptom: Schema changes not appearing in production
Solution:
- Check Supabase dashboard for migration errors
- Review migration files for syntax errors
- Verify database connection
Important Notes
- ⚠️ Production was cloned without migration history - This is expected
- ✅ Migrations will still apply - Even if history is missing
- 🔧 History can be fixed later - Using SQL cleanup approach
- 📊 Monitor closely - Watch for errors after deployment
Quick Reference
- Production Project: zvyvpucxdnftgrixxrxy
- Dashboard: https://supabase.com/dashboard/project/zvyvpucxdnftgrixxrxy
- SQL Editor: https://supabase.com/dashboard/project/zvyvpucxdnftgrixxrxy/sql
Post-Deployment
- Verify all migrations applied
- Test critical user flows
- Monitor error logs
- Check application performance
- Document any issues encountered