-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-storage.sh
More file actions
executable file
·51 lines (41 loc) · 1.53 KB
/
setup-storage.sh
File metadata and controls
executable file
·51 lines (41 loc) · 1.53 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Setup script for Supabase storage buckets
# This script helps set up the required storage buckets for the real-time collaborative platform
echo "🚀 Setting up Supabase storage buckets..."
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Docker is not running. Please start Docker and try again."
exit 1
fi
# Check if Supabase containers are running
if ! docker ps | grep -q "supabase-storage"; then
echo "❌ Supabase storage container is not running."
echo "Please start your Supabase services first:"
echo " docker-compose up -d"
exit 1
fi
echo "✅ Supabase storage is running"
# Execute the storage setup SQL
echo "📦 Creating storage buckets..."
# Get the database container name
DB_CONTAINER=$(docker ps --filter "name=supabase-db" --format "{{.Names}}")
if [ -z "$DB_CONTAINER" ]; then
echo "❌ Could not find Supabase database container"
exit 1
fi
# Execute the SQL script
docker exec -i "$DB_CONTAINER" psql -U postgres -d postgres < setup-storage-buckets.sql
if [ $? -eq 0 ]; then
echo "✅ Storage buckets created successfully!"
echo ""
echo "📋 Created buckets:"
echo " - workspace-logos (for workspace logos)"
echo " - profile-pictures (for user profile pictures)"
echo " - file-banners (for file and folder banners)"
echo ""
echo "🎉 You can now upload logos and images in your application!"
else
echo "❌ Failed to create storage buckets"
echo "Please check your Supabase setup and try again."
exit 1
fi