Add crussell_test database creation and schema seeding to dev script
- Create crussell_test database after PostgreSQL reset - Seed test DB schema from init-script.sql so tests can run - This fixes the TLS connection errors in test runs Also: - Fixed color variables in script (C_RESET, C_GREEN, etc.)
This commit is contained in:
+18
-1
@@ -14,6 +14,12 @@ C_GREEN=$'\033[32m'
|
||||
C_RED=$'\033[31m'
|
||||
C_BLUE=$'\033[34m'
|
||||
C_YELLOW=$'\033[33m'
|
||||
# Color codes for output
|
||||
C_RESET=$'\033[0m'
|
||||
C_GREEN=$'\033[32m'
|
||||
C_RED=$'\033[31m'
|
||||
C_BLUE=$'\033[34m'
|
||||
C_YELLOW=$'\033[33m'
|
||||
log_info() { echo "🔹 $1" }
|
||||
log_success() { echo "✅ $1" }
|
||||
log_error() { echo "❌ $1" }
|
||||
@@ -49,7 +55,18 @@ docker compose up postgres -d > /dev/null 2>&1
|
||||
log_success "PostgreSQL reset complete"
|
||||
sleep 3
|
||||
|
||||
# --- 3b. Rustfs (don't wipe data, just restart) ---
|
||||
# --- 3b. Create Test Database ---
|
||||
log_step "Setting up test database (crussell_test)..."
|
||||
docker exec postgres psql -U myuser -d mydb -c "CREATE DATABASE crussell_test;" 2>/dev/null || true
|
||||
log_success "Test database ready"
|
||||
sleep 1
|
||||
|
||||
# --- 3c. Seed Test Database Schema ---
|
||||
log_step "Seeding test database schema..."
|
||||
docker exec -i postgres psql -U myuser -d crussell_test < init-scripts/init-script.sql > /dev/null 2>&1 || true
|
||||
log_success "Test database schema ready"
|
||||
|
||||
# --- 3d. Rustfs (don't wipe data, just restart) ---
|
||||
log_step "Restarting Rustfs (S3-compatible storage)..."
|
||||
docker compose restart rustfs > /dev/null 2>&1
|
||||
log_success "Rustfs restarted"
|
||||
|
||||
Reference in New Issue
Block a user