Fix auth for 1.0.0: add logout endpoint, fix JWT claims consistency, add session revocation
This commit is contained in:
46
go_cloud/migrations/run-migrations.sh
Normal file
46
go_cloud/migrations/run-migrations.sh
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
# Database Migration Runner for b0esche.cloud
|
||||
# Runs all SQL migrations in order
|
||||
|
||||
set -e
|
||||
|
||||
# Check for required environment variable
|
||||
if [ -z "$DATABASE_URL" ]; then
|
||||
echo "ERROR: DATABASE_URL environment variable not set"
|
||||
echo "Example: DATABASE_URL=postgres://user:pass@localhost:5432/dbname"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
echo "=== b0esche.cloud Database Migrations ==="
|
||||
echo "Database: $DATABASE_URL"
|
||||
echo
|
||||
|
||||
# Function to run a single migration
|
||||
run_migration() {
|
||||
local file=$1
|
||||
echo "Running: $(basename $file)"
|
||||
psql "$DATABASE_URL" -f "$file" -v ON_ERROR_STOP=1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✓ Success"
|
||||
else
|
||||
echo "✗ Failed"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Run migrations in order
|
||||
echo "Step 1/3: Initial schema..."
|
||||
run_migration "$SCRIPT_DIR/0001_initial.sql"
|
||||
|
||||
echo
|
||||
echo "Step 2/3: Passkeys and authentication..."
|
||||
run_migration "$SCRIPT_DIR/0002_passkeys.sql"
|
||||
|
||||
echo
|
||||
echo "Step 3/3: Files and storage..."
|
||||
run_migration "$SCRIPT_DIR/0003_files.sql"
|
||||
|
||||
echo
|
||||
echo "=== All migrations completed successfully! ==="
|
||||
Reference in New Issue
Block a user