Config TypeORM
module.exports = {
type: 'postgres',
host: process.env.DB_HOST,
port: process.env.DB_PORT,
username: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
synchronize: process.env.NODE_ENV !== ('production' || 'staging') ? true : false,
entities: ['src/models/*.ts'],
migrations: ['src/database//migrations/*.ts'],
cli: {
entitiesDir: 'src/models',
migrationsDir: 'src/database/migrations'
}
}
Restu Wahyu Saputra