generated from chavda-bhavik/graphql-typeorm-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathormconfig.js
executable file
·52 lines (51 loc) · 1.44 KB
/
ormconfig.js
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
50
51
52
const path = require('path');
module.exports = [
{
name: 'development',
type: 'postgres',
database: 'schoacher',
username: 'power',
password: 'power',
synchronize: true,
logging: false,
entities: ['dist/entities/*.js'],
migrations: ['src/migration/*.ts'],
subscribers: ['src/subscriber/*.ts'],
cli: {
entitiesDir: 'src/entity',
migrationsDir: 'src/migration',
subscribersDir: 'src/subscriber',
},
},
{
name: 'test',
type: 'postgres',
database: 'schoacher-test',
username: 'power',
password: 'power',
synchronize: true,
dropSchema: true,
entities: [path.join(__dirname, './src/entities/*.ts')],
},
{
name: 'production',
type: 'postgres',
url: process.env.DATABASE_URL,
synchronize: true, // switch this to false once you have the initial tables created and use migrations instead
logging: false,
ssl: true,
entities: ['dist/entities/*.js'],
migrations: ['src/migration/*.ts'],
subscribers: ['src/subscriber/*.ts'],
extra: {
ssl: {
rejectUnauthorized: false,
},
},
cli: {
entitiesDir: 'dist/entity',
migrationsDir: 'dist/migration',
subscribersDir: 'dist/subscriber',
},
},
];