Files
twenty/server/src/metadata/metadata.datasource.ts
martmull fe20be8487 0.2.0 cleaning script (#2403)
* Update cleaning script to run on old schema

* Add boundaries parameter

* Stop requesting data for each workspace/table

* Stop checking same as seed if not requested

* Minor update

* Minor update

* Minor update

* Minor update

* Minor update

* Simplify result

* Simplify result

* Simplify result

* Delete updates

* Fix issues

* Update logs

* Remove throw when schema does not exist

* Remove missing table in old schema

* Remove boundaries parameter

* Remove useless trycatch
2023-11-09 12:18:09 +01:00

26 lines
741 B
TypeScript

import { ConfigService } from '@nestjs/config';
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
import { DataSource, DataSourceOptions } from 'typeorm';
import { config } from 'dotenv';
config();
const configService = new ConfigService();
export const typeORMMetadataModuleOptions: TypeOrmModuleOptions = {
url: configService.get<string>('PG_DATABASE_URL'),
type: 'postgres',
logging: ['error'],
schema: 'metadata',
entities: [__dirname + '/**/*.entity{.ts,.js}'],
synchronize: false,
migrationsRun: false,
migrationsTableName: '_typeorm_migrations',
migrations: [__dirname + '/migrations/*{.ts,.js}'],
};
export const connectionSource = new DataSource(
typeORMMetadataModuleOptions as DataSourceOptions,
);