mirror of
				https://github.com/lingble/twenty.git
				synced 2025-10-30 04:12:28 +00:00 
			
		
		
		
	| @@ -17,6 +17,7 @@ export const typeORMCoreModuleOptions: TypeOrmModuleOptions = { | ||||
|   synchronize: false, | ||||
|   migrationsRun: false, | ||||
|   migrationsTableName: '_typeorm_migrations', | ||||
|   metadataTableName: '_typeorm_generated_columns_and_materialized_views', | ||||
|   migrations: [ | ||||
|     `${isJest ? '' : 'dist/'}src/database/typeorm/core/migrations/*{.ts,.js}`, | ||||
|   ], | ||||
|   | ||||
| @@ -1,22 +0,0 @@ | ||||
| import { MigrationInterface, QueryRunner } from 'typeorm'; | ||||
|  | ||||
| export class AddTypeOrmMetadata1726848397026 implements MigrationInterface { | ||||
|   name = 'AddTypeOrmMetadata1726848397026'; | ||||
|  | ||||
|   public async up(queryRunner: QueryRunner): Promise<void> { | ||||
|     await queryRunner.query(` | ||||
|             CREATE TABLE "core"."typeorm_metadata" ( | ||||
|                 "type" character varying NOT NULL, | ||||
|                 "database" character varying, | ||||
|                 "schema" character varying, | ||||
|                 "table" character varying, | ||||
|                 "name" character varying, | ||||
|                 "value" text | ||||
|             ) | ||||
|         `); | ||||
|   } | ||||
|  | ||||
|   public async down(queryRunner: QueryRunner): Promise<void> { | ||||
|     await queryRunner.query(`DROP TABLE "core"."typeorm_metadata"`); | ||||
|   } | ||||
| } | ||||
| @@ -0,0 +1,26 @@ | ||||
| import { MigrationInterface, QueryRunner } from 'typeorm'; | ||||
|  | ||||
| export class AddTypeormGeneratedColumns1728314605995 | ||||
|   implements MigrationInterface | ||||
| { | ||||
|   name = 'AddTypeormGeneratedColumnsAndMaterializedViews1728314605995'; | ||||
|  | ||||
|   public async up(queryRunner: QueryRunner): Promise<void> { | ||||
|     await queryRunner.query(` | ||||
|                 CREATE TABLE "core"."_typeorm_generated_columns_and_materialized_views" ( | ||||
|                     "type" character varying NOT NULL, | ||||
|                     "database" character varying, | ||||
|                     "schema" character varying, | ||||
|                     "table" character varying, | ||||
|                     "name" character varying, | ||||
|                     "value" text | ||||
|                 ) | ||||
|             `); | ||||
|   } | ||||
|  | ||||
|   public async down(queryRunner: QueryRunner): Promise<void> { | ||||
|     await queryRunner.query( | ||||
|       `DROP TABLE "core"."_typeorm_generated_columns_and_materialized_views"`, | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @@ -2,17 +2,17 @@ import { Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common'; | ||||
|  | ||||
| import { DataSource } from 'typeorm'; | ||||
|  | ||||
| import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service'; | ||||
| import { DataSourceEntity } from 'src/engine/metadata-modules/data-source/data-source.entity'; | ||||
| import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity'; | ||||
| import { BillingSubscriptionItem } from 'src/engine/core-modules/billing/entities/billing-subscription-item.entity'; | ||||
| import { BillingSubscription } from 'src/engine/core-modules/billing/entities/billing-subscription.entity'; | ||||
| import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service'; | ||||
| import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity'; | ||||
| import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity'; | ||||
| import { PostgresCredentials } from 'src/engine/core-modules/postgres-credentials/postgres-credentials.entity'; | ||||
| import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity'; | ||||
| import { User } from 'src/engine/core-modules/user/user.entity'; | ||||
| import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity'; | ||||
| import { DataSourceEntity } from 'src/engine/metadata-modules/data-source/data-source.entity'; | ||||
|  | ||||
| @Injectable() | ||||
| export class TypeORMService implements OnModuleInit, OnModuleDestroy { | ||||
| @@ -37,6 +37,7 @@ export class TypeORMService implements OnModuleInit, OnModuleDestroy { | ||||
|         BillingSubscriptionItem, | ||||
|         PostgresCredentials, | ||||
|       ], | ||||
|       metadataTableName: '_typeorm_generated_columns_and_materialized_views', | ||||
|       ssl: environmentService.get('PG_SSL_ALLOW_SELF_SIGNED') | ||||
|         ? { | ||||
|             rejectUnauthorized: false, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Marie
					Marie