mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-19 19:21:33 +10:00
🚀 release v3.0.0
This commit is contained in:
26
server/src/database/database.module.ts
Normal file
26
server/src/database/database.module.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { Resume } from '@/resume/entities/resume.entity';
|
||||
import { User } from '@/users/entities/user.entity';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forRootAsync({
|
||||
imports: [ConfigModule],
|
||||
inject: [ConfigService],
|
||||
useFactory: async (configService: ConfigService) => ({
|
||||
type: 'postgres',
|
||||
host: configService.get<string>('postgres.host'),
|
||||
port: configService.get<number>('postgres.port'),
|
||||
username: configService.get<string>('postgres.username'),
|
||||
password: configService.get<string>('postgres.password'),
|
||||
database: configService.get<string>('postgres.database'),
|
||||
synchronize: true,
|
||||
entities: [User, Resume],
|
||||
}),
|
||||
}),
|
||||
],
|
||||
})
|
||||
export class DatabaseModule {}
|
||||
3
server/src/database/errorCodes.enum.ts
Normal file
3
server/src/database/errorCodes.enum.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export enum PostgresErrorCode {
|
||||
UniqueViolation = '23505',
|
||||
}
|
||||
0
server/src/database/migrations/.gitkeep
Normal file
0
server/src/database/migrations/.gitkeep
Normal file
Reference in New Issue
Block a user