rename core-module environment to twenty-config (#11445)

closes https://github.com/twentyhq/core-team-issues/issues/759
This commit is contained in:
nitin
2025-04-09 17:41:26 +05:30
committed by GitHub
parent fe6d0241a8
commit bd3ec6d5e3
193 changed files with 1454 additions and 1422 deletions

View File

@ -2,9 +2,9 @@ import { Injectable, Logger } from '@nestjs/common';
import { EntitySchema } from 'typeorm';
import { NodeEnvironment } from 'src/engine/core-modules/environment/interfaces/node-environment.interface';
import { NodeEnvironment } from 'src/engine/core-modules/twenty-config/interfaces/node-environment.interface';
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
import { DataSourceService } from 'src/engine/metadata-modules/data-source/data-source.service';
import { WorkspaceMetadataCacheService } from 'src/engine/metadata-modules/workspace-metadata-cache/services/workspace-metadata-cache.service';
import { WorkspaceDataSource } from 'src/engine/twenty-orm/datasource/workspace.datasource';
@ -24,7 +24,7 @@ export class WorkspaceDatasourceFactory {
constructor(
private readonly dataSourceService: DataSourceService,
private readonly environmentService: EnvironmentService,
private readonly twentyConfigService: TwentyConfigService,
private readonly workspaceCacheStorageService: WorkspaceCacheStorageService,
private readonly workspaceMetadataCacheService: WorkspaceMetadataCacheService,
private readonly entitySchemaFactory: EntitySchemaFactory,
@ -124,16 +124,16 @@ export class WorkspaceDatasourceFactory {
{
url:
dataSourceMetadata.url ??
this.environmentService.get('PG_DATABASE_URL'),
this.twentyConfigService.get('PG_DATABASE_URL'),
type: 'postgres',
logging:
this.environmentService.get('NODE_ENV') ===
this.twentyConfigService.get('NODE_ENV') ===
NodeEnvironment.development
? ['query', 'error']
: ['error'],
schema: dataSourceMetadata.schema,
entities: cachedEntitySchemas,
ssl: this.environmentService.get('PG_SSL_ALLOW_SELF_SIGNED')
ssl: this.twentyConfigService.get('PG_SSL_ALLOW_SELF_SIGNED')
? {
rejectUnauthorized: false,
}