Skip to content
Snippets Groups Projects
Commit 445e068c authored by Daniel's avatar Daniel
Browse files

ENH: make_db now can insert database dumps.

parent 25ef8d02
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,12 @@ Call 'make drop-$DATABASE_NAME' to delete that database or reconfigure with
sed "s/db_2_0/$DATABASE_NAME/g" "$INSTALL_SQL_FILE" | $SQL
}
# Inserts the dump (arg 1) into the database
function restore_db() {
SQL_FILE="$1"
$SQL -D "$DATABASE_NAME" < "$SQL_FILE"
}
function test-connection() {
$SQL -e "select 0;"
}
......@@ -138,6 +144,7 @@ case $1 in
"grant") grant $2 ;;
"test-connection") test-connection ;;
"install_db") install_db ;;
"restore_db") restore_db $2 ;;
# "prep_sql") prepare_sql ;;
*) echo "Unknown action: $1"
esac
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment