wire postgres session repo, migrations, seed, and dev serve

This commit is contained in:
Yisroel Baum 2026-05-17 22:01:27 +03:00
parent 02effe761a
commit 89b63cb9e9
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
8 changed files with 235 additions and 2 deletions

View file

@ -24,6 +24,25 @@
postgresql
process-compose
];
shellHook = ''
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
export PGDATA="$REPO_ROOT/.postgres"
export PGHOST="$PGDATA"
export PGUSER="postgres"
export PGDATABASE="rabbigerzi"
if [ ! -d "$PGDATA" ]; then
echo "[pg] initializing cluster at $PGDATA"
initdb --auth=trust --username=postgres --no-locale --encoding=UTF8 >/dev/null
{
echo "listen_addresses = '127.0.0.1'"
echo "unix_socket_directories = '$PGDATA'"
} >> "$PGDATA/postgresql.conf"
fi
echo "[dev] run 'process-compose up' to start postgres + backend + vite"
'';
};
}
);