diff options
author | tom barrett <spalf0@gmail.com> | 2019-03-28 03:33:14 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-03-28 07:24:51 -0500 |
commit | f8c446ce74329fc5844e0fc1fd82e618242196f4 (patch) | |
tree | 02319b823da4888c6d4e2faa9f482be11caad353 /postgres | |
parent | ca5ee0b32b616fb8fa5e7e44c74acecefab719c3 (diff) |
migrate and revert executable, query insert and delete test
Diffstat (limited to 'postgres')
-rw-r--r-- | postgres/bootstrap.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/postgres/bootstrap.sh b/postgres/bootstrap.sh index 391aeab..070e104 100644 --- a/postgres/bootstrap.sh +++ b/postgres/bootstrap.sh @@ -10,8 +10,12 @@ apt-get install -y xauth apt-get install -y postgresql postgresql-client pgadmin3 # set up db -sudo -u postgres psql -c "CREATE USER space WITH PASSWORD 'space';" -sudo -u postgres psql -c "CREATE DATABASE space_db WITH OWNER space;" +USERNAME=$(grep POSTGRES_USERNAME /vagrant/src/constants.rs | cut -d '"' -f2) +PASSWORD=$(grep POSTGRES_PASSWORD /vagrant/src/constants.rs | cut -d '"' -f2) +DB_NAME=$(grep POSTGRES_DB_NAME /vagrant/src/constants.rs | cut -d '"' -f2) + +sudo -u postgres psql -c "CREATE USER $USERNAME WITH PASSWORD '$PASSWORD';" +sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $USERNAME;" # copy configs cp /vagrant/postgres/*conf /etc/postgresql/9.6/main/ |