view scripts/database/drop-create.sh @ 11:08c950a22cee

new: add getAllDataverseAlias api for LGServices
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 09 Sep 2015 17:13:18 +0200
parents a50cf11e5178
children
line wrap: on
line source

#!/bin/bash

# Drops and creates the database. Assumes pg_dump and psql are in $PATH, and that the db does not need password.
DUMP=pg_dump
PSQL=psql
DB=dvndb
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

$DUMP -s $DB > temp-schema.sql
$PSQL -d $DB -f $DIR/drop-all.sql
$PSQL -d $DB -f temp-schema.sql
rm temp-schema.sql