File size: 760 Bytes
5c244a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
# Initialize Neon Database
# Usage: ./scripts/init_db.sh

set -e

echo "πŸš€ Initializing Neon Database..."

# Database connection
DB_URL="postgresql://neondb_owner:npg_4oK0utXaHpci@ep-broad-darkness-abnsobdy-pooler.eu-west-2.aws.neon.tech/neondb?sslmode=require&channel_binding=require"

# Check if psql is available
if ! command -v psql &> /dev/null; then
    echo "❌ psql not found. Please install PostgreSQL client"
    exit 1
fi

echo "πŸ“Š Running schema migration..."
psql "$DB_URL" -f src/utils/database/schema.sql

echo "βœ… Database initialized successfully!"
echo ""
echo "πŸ“ Tables created:"
echo "  - users"
echo "  - tasks"
echo "  - reminders"
echo "  - conversations"
echo "  - messages"
echo "  - events"
echo "  - audit_logs"