Skip to content

Instantly share code, notes, and snippets.

@mahasak
Created June 20, 2020 09:15
Show Gist options
  • Save mahasak/82dc17faf73863832bf91c1589424931 to your computer and use it in GitHub Desktop.
Save mahasak/82dc17faf73863832bf91c1589424931 to your computer and use it in GitHub Desktop.
reload db postgres script
#!/bin/bash
if [[ ! -n $REIMPORTDB_PATH ]]; then
export REIMPORTDB_PATH=/usr/local/bin/
fi
${REIMPORTDB_PATH}dropdb --if-exists {DB_NAME}
${REIMPORTDB_PATH}createdb -U{DB_USER} -O{DB_USER} {DB_NAME}
${REIMPORTDB_PATH}psql -U{DB_USER} {DB_NAME} < database/schema_postgres.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment