forked from Sxip/critters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathormconfig.ts
49 lines (46 loc) · 1.05 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions'
import config from './src/config'
/**
* Connection options interface.
*
* @interface
*/
interface IConnectionOptions extends PostgresConnectionOptions {
readonly seeds: string[]
readonly factories: string[]
}
/**
* Orm configuration.
*
* @constant
*/
const ormconfig: IConnectionOptions = {
type: 'postgres',
host: config.database.host,
username: config.database.username,
password: config.database.password,
database: config.database.database,
logging: false,
synchronize: false,
entities: [
'src/database/models/*.{ts,js}',
],
subscribers: [
'src/database/subscribers/*.{ts,js}',
],
migrations: [
'src/database/migrations/*.{ts,js}',
],
seeds: [
'src/database/seeds/*.{ts,js}',
],
factories: [
'src/database/factories/*.{ts,js}',
],
cli: {
entitiesDir: 'src/database/models',
migrationsDir: 'src/database/migrations',
subscribersDir: 'src/database/models',
},
}
module.exports = ormconfig