forked from Shared/esg
database migrated to POSTGRESQL
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import 'dotenv/config';
|
||||
import { join } from 'path';
|
||||
import { DataSource } from 'typeorm';
|
||||
import { AuditLog } from '../audit/schemas/audit-log.schema';
|
||||
import { IdempotencyRecord } from '../idempotency/schemas/idempotency-record.schema';
|
||||
import { InquiryLog } from '../logging/schemas/inquiry-log.schema';
|
||||
import { DistributedLock } from '../providers/schemas/distributed-lock.schema';
|
||||
import { GeneralToken } from '../providers/schemas/general-token.schema';
|
||||
import { InquiryResultCache } from '../providers/schemas/inquiry-result-cache.schema';
|
||||
import { User } from '../users/schemas/user.schema';
|
||||
import { SnakeNamingStrategy } from './snake-naming.strategy';
|
||||
|
||||
export const AppDataSource = new DataSource({
|
||||
type: 'postgres',
|
||||
url: process.env.DATABASE_URL ?? 'postgresql://esg:esg@localhost:5432/inquiry_gateway',
|
||||
synchronize: false,
|
||||
namingStrategy: new SnakeNamingStrategy(),
|
||||
entities: [
|
||||
User,
|
||||
AuditLog,
|
||||
InquiryLog,
|
||||
InquiryResultCache,
|
||||
GeneralToken,
|
||||
IdempotencyRecord,
|
||||
DistributedLock,
|
||||
],
|
||||
migrations: [join(__dirname, 'migrations', '*.{js,ts}')],
|
||||
});
|
||||
Reference in New Issue
Block a user