This commit is contained in:
syuilo 2019-05-14 23:54:39 +09:00
parent 678d610cd6
commit e5409db0e8
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
4 changed files with 23 additions and 22 deletions

18
src/ormconfig.ts Normal file
View file

@ -0,0 +1,18 @@
import * as fs from 'fs';
import config from './config';
const json = {
type: 'postgres',
host: config.db.host,
port: config.db.port,
username: config.db.user,
password: config.db.pass,
database: config.db.db,
entities: ['src/models/entities/*.ts'],
migrations: ['migration/*.ts'],
cli: {
migrationsDir: 'migration'
}
};
fs.writeFileSync('ormconfig.json', JSON.stringify(json));