summaryrefslogtreecommitdiff
path: root/bin/create_db.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/create_db.sh')
-rw-r--r--bin/create_db.sh12
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."
+}