Initial commit 050212
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import 'dotenv/config';
|
||||
import { join } from 'path';
|
||||
import { DataSource } from 'typeorm';
|
||||
|
||||
/**
|
||||
* CLI-only DataSource (migration generate/run/revert).
|
||||
* Paths point at src so migrations stay in TypeScript before build.
|
||||
*/
|
||||
export default new DataSource({
|
||||
type: 'postgres',
|
||||
host: process.env.DB_HOST,
|
||||
port: parseInt(process.env.POSTGRES_PORT || '5432', 10),
|
||||
username: process.env.POSTGRES_USER,
|
||||
password: process.env.POSTGRES_PASSWORD,
|
||||
database: process.env.POSTGRES_DB,
|
||||
entities: [join(__dirname, '..', '**', '*.entity.ts')],
|
||||
migrations: [join(__dirname, 'migrations', '*.ts')],
|
||||
synchronize: false,
|
||||
});
|
||||
Reference in New Issue
Block a user