entities, init schema migration

This commit is contained in:
Pravdin Egor
2023-09-19 20:37:42 +07:00
parent 51344d2018
commit 968d83e58b
16 changed files with 347 additions and 17 deletions
+18
View File
@@ -0,0 +1,18 @@
import { DataSource } from 'typeorm';
import { ConfigService } from '@nestjs/config';
import { config } from 'dotenv';
config();
const configService = new ConfigService();
export default new DataSource({
type: 'postgres',
host: configService.get('DB_HOST'),
port: +configService.get('DB_PORT'),
username: configService.get('DB_USER'),
password: configService.get('DB_PASSWORD'),
database: configService.get('DB_NAME'),
entities: ['dist/**/*.entity.js'],
migrations: ['migrations/**/*'],
});