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:
@cd lib/mix/tasks/secrets/ && mix escript.build && ./secrets 128 3
# start or stop nix postgres server
nix-pg pg_cmd:
@pg_ctl -D ${PGDATA} -l ${PGDATA}/all.log -o "--unix_socket_directories='${PGDATA}'" $pg_cmd
# Start or stop nix postgres server
@nix-pg 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";
# remove dotenv variables POSTGRES_* to use these!
PGUSERNAME = "postgres";
PGUSERNAME = "bonfire";
PGDATABASE = "bonfire_db";
PGPASS = "password";
}