]> Git — Sourcephile - gargantext.git/blob - devops/postgres/create
[DB] config postgres script.
[gargantext.git] / devops / postgres / create
1 #!/bin/bash
2
3 sudo su postgres
4
5 PW="password"
6 DB="gargandbV5"
7 USER="gargantua"
8
9 psql -c "CREATE USER \"${USER}\"
10 psql -c "ALTER USER \"${USER}\" with PASSWORD \"${PW}\""
11
12 psql -c "DROP DATABASE IF EXISTS \"${DB}\""
13 createdb "${DB}"
14 psql "${DB}" < schema.sql
15
16 psql -c "ALTER DATABASE \"${DB}\" OWNER to \"${USER}\" ;"
17
18
19
20
21