fix: update setup script to grant sequence permissions and ensure future privileges for user
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 8s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 8s
This commit is contained in:
@@ -77,8 +77,15 @@ EOF
|
||||
|
||||
echo "[7] Grant privileges to user…"
|
||||
sudo -u postgres psql -d $DB_NAME <<EOF
|
||||
-- Grant all table privileges
|
||||
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO $DB_USER;
|
||||
|
||||
-- Grant sequence permissions (needed for SERIAL / BIGSERIAL)
|
||||
GRANT USAGE, SELECT, UPDATE ON ALL SEQUENCES IN SCHEMA public TO $DB_USER;
|
||||
|
||||
-- Ensure future tables & sequences also get permissions
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON TABLES TO $DB_USER;
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT USAGE, SELECT, UPDATE ON SEQUENCES TO $DB_USER;
|
||||
EOF
|
||||
|
||||
echo "Done. PostgreSQL is ready for LAN + localhost connections."
|
||||
|
||||
Reference in New Issue
Block a user