migrate-sqlite-to-pg.sh: korrektes Parsen des DB-Namens aus DATABASE_URL
This commit is contained in:
@@ -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_USER=$(sed -n 's|.*://\([^:@]*\):.*|\1|p' <<<"$DB_URL")
|
||||||
PG_PASS=$(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_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"
|
export PGPASSWORD="$PG_PASS"
|
||||||
|
|
||||||
echo "== 1) SQLite-Export (CSV) aus dem laufenden Container"
|
echo "== 1) SQLite-Export (CSV) aus dem laufenden Container"
|
||||||
|
|||||||
Reference in New Issue
Block a user