Skip to content

Instantly share code, notes, and snippets.

@daryl-sf
Created April 4, 2019 14:41
Show Gist options
  • Save daryl-sf/9d34f8a8153f7a6791c5e0e18bda271d to your computer and use it in GitHub Desktop.
Save daryl-sf/9d34f8a8153f7a6791c5e0e18bda271d to your computer and use it in GitHub Desktop.
drop and recreate dev
#!/bin/bash
echo 'Dropping squarefoot_development DB';
dropdb 'squarefoot_development';
echo 'Recreating squarefoot_development DB';
psql -c 'create database squarefoot_development';
psql squarefoot_development -c 'CREATE extension plpgsql';
psql squarefoot_development -c 'CREATE extension postgis';
psql squarefoot_development -c 'CREATE extension hstore';
pg_restore --verbose --clean --create --no-acl --no-owner -h localhost -U $USER -d squarefoot_development $1
echo 'Done!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment