-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush_migration.sh
More file actions
executable file
·35 lines (30 loc) · 878 Bytes
/
Copy pathpush_migration.sh
File metadata and controls
executable file
·35 lines (30 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Push Supabase migrations
echo "📦 Pushing Inner City ticketing schema to Supabase..."
# Check if logged in
if ! supabase projects list &>/dev/null; then
echo "❌ Not logged in to Supabase CLI"
echo "Run: supabase login"
exit 1
fi
# Check if linked
if ! supabase status &>/dev/null 2>&1; then
echo "📎 Project not linked. You'll need to link it first."
echo ""
echo "To link your project:"
echo "1. Get your project ref from: https://app.supabase.com"
echo "2. Run: supabase link --project-ref YOUR_PROJECT_REF"
echo ""
read -p "Do you want to link now? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
read -p "Enter your project ref: " PROJECT_REF
supabase link --project-ref "$PROJECT_REF"
else
exit 1
fi
fi
# Push migrations
echo "🚀 Pushing migrations..."
supabase db push
echo "✅ Migration complete!"