Rado
Rado
PPrisma
Created by Rado on 11/26/2024 in #help-and-questions
How to run migrations with SET ROLE xxx
The issue was resolved by adding the options parameter to the DATABASE_URL. This ensures that the desired role is automatically set for every connection to the database, including migrations or other operations. Solution: postgresql://USER:PASSWORD@HOST:PORT/DB_NAME?schema=SCHEMA&options=-c%20role%3DYOUR_ROLE --- • Replace USER, PASSWORD, HOST, PORT, DB_NAME, SCHEMA, and YOUR_ROLE with your actual database credentials and desired role. • The options=-c role=YOUR_ROLE part ensures that the role is set automatically on every new connection.
7 replies
PPrisma
Created by Rado on 11/26/2024 in #help-and-questions
How to run migrations with SET ROLE xxx
so the first migration should have only the SET ROLE xxx; and then the rest migration will be normal ?
7 replies