chatbridge/server/db/data-source.ts

23 lines
589 B
TypeScript
Raw Normal View History

require('dotenv').config();
import 'reflect-metadata';
import { DataSource } from 'typeorm';
import config from 'config';
const postgresConfig = config.get<{
host: string;
port: number;
username: string;
password: string;
database: string;
}>('postgresConfig');
export const AppDataSource = new DataSource({
...postgresConfig,
type: 'postgres',
2023-07-25 01:40:22 +00:00
synchronize: true,
logging: false,
entities: ['server/entities/**/*.entity{.ts,.js}'],
migrations: ['server/migrations/**/*{.ts,.js}'],
// subscribers: ['server/subscribers/**/*{.ts,.js}'],
});