Fix migration search path (#6520)
This commit is contained in:
@ -74,12 +74,11 @@ export class WorkspaceMigrationRunnerService {
|
||||
await queryRunner.connect();
|
||||
await queryRunner.startTransaction();
|
||||
|
||||
// Reset search_path to force to postgres to prefix migrations in the correct schema due to postgres driver behavior
|
||||
await queryRunner.query('SET search_path TO public');
|
||||
|
||||
const schemaName =
|
||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||
|
||||
await queryRunner.query(`SET LOCAL search_path TO ${schemaName}`);
|
||||
|
||||
try {
|
||||
// Loop over each migration and create or update the table
|
||||
for (const migration of flattenedPendingMigrations) {
|
||||
|
||||
Reference in New Issue
Block a user