2019-05-14 23:54:39 +09:00
|
|
|
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,
|
2019-05-24 03:26:56 +09:00
|
|
|
extra: config.db.extra,
|
2019-06-29 15:58:04 +09:00
|
|
|
entities: ['src/models/entities/*.ts'],
|
2019-05-14 23:54:39 +09:00
|
|
|
migrations: ['migration/*.ts'],
|
|
|
|
cli: {
|
|
|
|
migrationsDir: 'migration'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
fs.writeFileSync('ormconfig.json', JSON.stringify(json));
|