COBY : specs + task 1
This commit is contained in:
37
COBY/docker/manual-init.sh
Normal file
37
COBY/docker/manual-init.sh
Normal file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Manual database initialization script
|
||||
# Run this to initialize the TimescaleDB schema
|
||||
|
||||
echo "🔧 Initializing TimescaleDB schema..."
|
||||
|
||||
# Check if we can connect to the database
|
||||
echo "📡 Testing connection to TimescaleDB..."
|
||||
|
||||
# You can run this command on your Docker host (192.168.0.10)
|
||||
# Replace with your actual password from the .env file
|
||||
|
||||
PGPASSWORD="market_data_secure_pass_2024" psql -h 192.168.0.10 -p 5432 -U market_user -d market_data -c "SELECT version();"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Connection successful!"
|
||||
|
||||
echo "🏗️ Creating database schema..."
|
||||
|
||||
# Execute the initialization script
|
||||
PGPASSWORD="market_data_secure_pass_2024" psql -h 192.168.0.10 -p 5432 -U market_user -d market_data -f ../docker/init-scripts/01-init-timescaledb.sql
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Database schema initialized successfully!"
|
||||
|
||||
echo "📊 Verifying tables..."
|
||||
PGPASSWORD="market_data_secure_pass_2024" psql -h 192.168.0.10 -p 5432 -U market_user -d market_data -c "\dt market_data.*"
|
||||
|
||||
else
|
||||
echo "❌ Schema initialization failed"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "❌ Cannot connect to database"
|
||||
exit 1
|
||||
fi
|
Reference in New Issue
Block a user