diff options
author | Joseph Ditton <jditton.atomic@gmail.com> | 2021-12-03 18:31:24 -0700 |
---|---|---|
committer | Joseph Ditton <jditton.atomic@gmail.com> | 2021-12-03 18:31:24 -0700 |
commit | 5446509b96d5d5bcd0aa9855ce5b9568fe706eb7 (patch) | |
tree | dc9c47ceecaa4b0d80756601c91ae0352808bb28 /bin/create_db.sh | |
parent | edbbed205031fa21c42e309cbf1161e20135e44b (diff) | |
download | locchat-5446509b96d5d5bcd0aa9855ce5b9568fe706eb7.tar.gz locchat-5446509b96d5d5bcd0aa9855ce5b9568fe706eb7.zip |
update readme add git scripts
Diffstat (limited to 'bin/create_db.sh')
-rw-r--r-- | bin/create_db.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/create_db.sh b/bin/create_db.sh new file mode 100644 index 0000000..0144e64 --- /dev/null +++ b/bin/create_db.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +source .env +echo "Creating db '$DATABASE_URL'" + +pg_ctl status || pg_ctl start + +{ + createdb $DATABASE_URL && echo "Database '$DATABASE_URL' created successfully" +} || { + echo "Database '$DATABASE_URL' already exists, skipping creation." +} |