forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata-source.ts
More file actions
23 lines (21 loc) · 789 Bytes
/
Copy pathdata-source.ts
File metadata and controls
23 lines (21 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { DataSource } from 'typeorm';
import * as dotenv from 'dotenv';
import * as path from 'path';
dotenv.config({
path: path.resolve(__dirname, '../../.env'),
});
export const AppDataSource = new DataSource({
type: 'postgres',
host: process.env.DB_HOST || 'localhost',
port: parseInt(process.env.DB_PORT || '5432', 10),
username: process.env.DB_USERNAME || 'postgres',
password: process.env.DB_PASSWORD || 'postgres',
database: process.env.DB_NAME || 'stellarsplit_dev',
entities: [path.join(__dirname, '../**/*.entity{.ts,.js}')],
migrations: [
path.join(__dirname, 'migrations/*{.ts,.js}'),
path.join(__dirname, '../migrations/*{.ts,.js}'),
],
synchronize: false, // Should be false for migrations
logging: true,
});