migrate-sqlite-to-pg.sh: korrektes Parsen des DB-Namens aus DATABASE_URL

This commit is contained in:
2026-09-25 18:02:59 +02:00
parent ca9ffe7e46
commit 15de8e5516
+1 -1
View File
@@ -8,7 +8,7 @@ DB_URL=$(grep -m1 '^DATABASE_URL=' .env.local | sed 's/^DATABASE_URL=//; s/^"//;
PG_USER=$(sed -n 's|.*://\([^:@]*\):.*|\1|p' <<<"$DB_URL")
PG_PASS=$(sed -n 's|.*://[^:@]*:\([^@]*\)@.*|\1|p' <<<"$DB_URL")
PG_HOST=$(sed -n 's|.*@\([^:/?]*\).*|\1|p' <<<"$DB_URL")
PG_DB=$(sed -n 's|.*:/\([^?]*\).*|\1|p' <<<"$DB_URL")
PG_DB=$(sed -n 's|.*/\([^/?]*\).*|\1|p' <<<"$DB_URL")
export PGPASSWORD="$PG_PASS"
echo "== 1) SQLite-Export (CSV) aus dem laufenden Container"