From 24b4e789bec97b71a53a9d3135c0473675f15756 Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 13 Sep 2018 23:17:21 +1000 Subject: [PATCH 1/3] db init script --- ops/init_db.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 ops/init_db.sh diff --git a/ops/init_db.sh b/ops/init_db.sh new file mode 100755 index 00000000..54523a08 --- /dev/null +++ b/ops/init_db.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +sudo apt-get install -y postgresql postgresql-contrib +sudo service postgresql start +sudo -u postgres createdb cryps +sudo -u echo "craftbeer" > .pgpass +sudo -u postgres createuser --encrypted cryps \ No newline at end of file From f297b910eeb5a9651f9959081217c4e4194176ea Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 13 Sep 2018 23:21:04 +1000 Subject: [PATCH 2/3] echo pg --- ops/init_db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops/init_db.sh b/ops/init_db.sh index 54523a08..6b99f52d 100755 --- a/ops/init_db.sh +++ b/ops/init_db.sh @@ -3,5 +3,5 @@ sudo apt-get install -y postgresql postgresql-contrib sudo service postgresql start sudo -u postgres createdb cryps -sudo -u echo "craftbeer" > .pgpass +sudo -u postgres echo "craftbeer" > .pgpass sudo -u postgres createuser --encrypted cryps \ No newline at end of file From 2f58bd67b306a9e4861b20d8596b02e3b42f076a Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 13 Sep 2018 23:22:09 +1000 Subject: [PATCH 3/3] knex --- ops/init_db.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ops/init_db.sh b/ops/init_db.sh index 6b99f52d..65dc1c39 100755 --- a/ops/init_db.sh +++ b/ops/init_db.sh @@ -4,4 +4,8 @@ sudo apt-get install -y postgresql postgresql-contrib sudo service postgresql start sudo -u postgres createdb cryps sudo -u postgres echo "craftbeer" > .pgpass -sudo -u postgres createuser --encrypted cryps \ No newline at end of file +sudo -u postgres createuser --encrypted cryps + +npm i +npm i -g knex +knex migrate:latest