-
Notifications
You must be signed in to change notification settings - Fork 6
/
ormconfig.ts
32 lines (27 loc) · 916 Bytes
/
ormconfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { ConnectionOptions } from 'typeorm';
// Check typeORM documentation for more information.
const config: ConnectionOptions = {
type: 'postgres',
host: 'localhost',
port: 5432,
username: 'postgres',
password: 'eatsleepcode',
database: 'bitstack',
entities: ['src/database/entity/*.ts'],
// We are using migrations, synchronize should be set to false.
synchronize: false,
// Run migrations automatically,
// you can disable this if you prefer running migration manually.
migrationsRun: true,
logging: false,
// Allow both start:prod and start:dev to use migrations
// __dirname is either dist or src folder, meaning either
// the compiled js in prod or the ts in dev.
migrations: ['out/database/migration/**/*{.ts,.js}'],
cli: {
// Location of migration should be inside src folder
// to be compiled into dist/ folder.
migrationsDir: 'src/database/migration'
}
};
export = config;