From 605a261a8ed170de54261d53385642aaeceb38d9 Mon Sep 17 00:00:00 2001 From: Masaki Yatsu Date: Wed, 20 Aug 2025 20:46:47 +0900 Subject: [PATCH] fix(postgres): grant create on schema public --- postgres/justfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/postgres/justfile b/postgres/justfile index 11002dc..971a2e8 100644 --- a/postgres/justfile +++ b/postgres/justfile @@ -137,6 +137,7 @@ create-user username='' password='': fi if [ -z "${PASSWORD}" ]; then PASSWORD=$(just random-password) + echo "Generated random password: ${PASSWORD}" fi just psql -c "\"CREATE USER ${USERNAME} WITH LOGIN PASSWORD '${PASSWORD}';\"" echo "User ${USERNAME} created." @@ -190,6 +191,8 @@ grant db_name='' username='': exit 1 fi just psql -c "\"GRANT ALL PRIVILEGES ON DATABASE ${DB_NAME} TO ${USERNAME};\"" + # Grant CREATE permission on public schema (needed for PostgreSQL 15+) + just psql -d ${DB_NAME} -c "\"GRANT CREATE ON SCHEMA public TO ${USERNAME};\"" echo "Privileges granted." # Revoke all privileges on database from user