feat: add just postgres init for nix

This commit is contained in:
Alejandro Baez 2022-07-30 16:05:55 -05:00 committed by Mayel de Borniol
parent f9e594ae24
commit a39cd3202b
2 changed files with 8 additions and 4 deletions

View file

@ -559,7 +559,11 @@ db-pre-migrations:
secrets: secrets:
@cd lib/mix/tasks/secrets/ && mix escript.build && ./secrets 128 3 @cd lib/mix/tasks/secrets/ && mix escript.build && ./secrets 128 3
# start or stop nix postgres server # Start or stop nix postgres server
nix-pg pg_cmd: @nix-pg pg_cmd:
@pg_ctl -D ${PGDATA} -l ${PGDATA}/all.log -o "--unix_socket_directories='${PGDATA}'" $pg_cmd pg_ctl -D ${PGDATA} -l ${PGDATA}/all.log -o "--unix_socket_directories='${PGDATA}'" $pg_cmd
# Initialize postgres database. Only need to run the first time!
nix-pg-init: (nix-pg "start")
createdb ${PGDATABASE}
createuser -dlsw ${PGUSERNAME}

View file

@ -9,7 +9,7 @@
erlang_release = "24"; erlang_release = "24";
# remove dotenv variables POSTGRES_* to use these! # remove dotenv variables POSTGRES_* to use these!
PGUSERNAME = "postgres"; PGUSERNAME = "bonfire";
PGDATABASE = "bonfire_db"; PGDATABASE = "bonfire_db";
PGPASS = "password"; PGPASS = "password";
} }