Skip to content

Commit 7ad7542

Browse files
authored
Add more modifications to how the db is set up (#5)
1 parent a74fd5b commit 7ad7542

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

orm-cli-config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dotenvExpand.expand(env);
1010
export default new DataSource({
1111
type: 'postgres',
1212
connectTimeoutMS: 3000,
13+
database: process.env.DATABASE_NAME,
1314
entities: [path.join(__dirname, '**', '*.entity.{ts,js}')],
1415
migrations: ['./migrations/*.ts'],
1516
migrationsTableName: 'typeorm_migrations',

src/app.module.ts

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { UserModule } from './user/user.module';
3535
useFactory: async (configService: ConfigService) => ({
3636
type: 'postgres',
3737
autoLoadEntities: true,
38+
database: configService.get('database.name'),
3839
entities: [join(__dirname, '/**/entity{.ts,.js}')],
3940
password: configService.get('database.password'),
4041
ssl: configService.get('database.useSsl') ? { rejectUnauthorized: true } : false,

0 commit comments

Comments
 (0)