mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-28 06:46:24 +03:00
Add logs to migration runner (#6518)
This commit is contained in:
parent
277c51d58e
commit
c5d95dc4c8
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable no-restricted-imports */
|
/* eslint-disable no-restricted-imports */
|
||||||
import { HttpModule } from '@nestjs/axios';
|
import { HttpModule } from '@nestjs/axios';
|
||||||
import { Module } from '@nestjs/common';
|
import { forwardRef, Module } from '@nestjs/common';
|
||||||
import { JwtModule } from '@nestjs/jwt';
|
import { JwtModule } from '@nestjs/jwt';
|
||||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ const jwtModule = JwtModule.registerAsync({
|
|||||||
jwtModule,
|
jwtModule,
|
||||||
FileUploadModule,
|
FileUploadModule,
|
||||||
DataSourceModule,
|
DataSourceModule,
|
||||||
UserModule,
|
forwardRef(() => UserModule),
|
||||||
WorkspaceManagerModule,
|
WorkspaceManagerModule,
|
||||||
TypeORMModule,
|
TypeORMModule,
|
||||||
TypeOrmModule.forFeature(
|
TypeOrmModule.forFeature(
|
||||||
|
@ -9,7 +9,6 @@ import {
|
|||||||
TableUnique,
|
TableUnique,
|
||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
|
|
||||||
import { WorkspaceCacheVersionService } from 'src/engine/metadata-modules/workspace-cache-version/workspace-cache-version.service';
|
|
||||||
import {
|
import {
|
||||||
WorkspaceMigrationColumnAction,
|
WorkspaceMigrationColumnAction,
|
||||||
WorkspaceMigrationColumnActionType,
|
WorkspaceMigrationColumnActionType,
|
||||||
@ -36,7 +35,6 @@ export class WorkspaceMigrationRunnerService {
|
|||||||
constructor(
|
constructor(
|
||||||
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
||||||
private readonly workspaceMigrationService: WorkspaceMigrationService,
|
private readonly workspaceMigrationService: WorkspaceMigrationService,
|
||||||
private readonly workspaceCacheVersionService: WorkspaceCacheVersionService,
|
|
||||||
private readonly workspaceMigrationEnumService: WorkspaceMigrationEnumService,
|
private readonly workspaceMigrationEnumService: WorkspaceMigrationEnumService,
|
||||||
private readonly workspaceMigrationTypeService: WorkspaceMigrationTypeService,
|
private readonly workspaceMigrationTypeService: WorkspaceMigrationTypeService,
|
||||||
) {}
|
) {}
|
||||||
@ -76,6 +74,9 @@ export class WorkspaceMigrationRunnerService {
|
|||||||
await queryRunner.connect();
|
await queryRunner.connect();
|
||||||
await queryRunner.startTransaction();
|
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 =
|
const schemaName =
|
||||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user