Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
vagrant: Merge db init .sql scripts in to reset-db.sql
Browse files Browse the repository at this point in the history
This makes reprovisioning idempotent.
  • Loading branch information
techtonik committed Nov 17, 2014
1 parent 81d650f commit 2055853
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 0 additions & 2 deletions scripts/create_db.sql

This file was deleted.

1 change: 0 additions & 1 deletion scripts/create_test_db.sql

This file was deleted.

7 changes: 7 additions & 0 deletions scripts/reset-db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
DROP DATABASE IF EXISTS "gratipay-test";
DROP DATABASE IF EXISTS gratipay;
DROP ROLE IF EXISTS gratipay;

CREATE ROLE gratipay LOGIN PASSWORD 'gratipay' SUPERUSER;
CREATE DATABASE gratipay WITH OWNER = gratipay;
CREATE DATABASE "gratipay-test" WITH OWNER = gratipay;
3 changes: 1 addition & 2 deletions scripts/vagrant-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ sudo sh -c "echo 'cd /vagrant' > /etc/profile.d/login-directory.sh"

# Configure Postgres (using system user 'postgres' run command
# 'psql' with PostreSQL user 'postgres` to quietly execute scripts)
sudo -u postgres psql -U postgres -qf /vagrant/scripts/create_db.sql
sudo -u postgres psql -U postgres -qf /vagrant/scripts/create_test_db.sql
sudo -u postgres psql -U postgres -qf /vagrant/scripts/reset-db.sql

# Set up the environment, the database, and run Gratipay
cd /vagrant && make clean env schema data
Expand Down

0 comments on commit 2055853

Please sign in to comment.