mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 14:20:58 +00:00
20 lines
702 B
TypeScript
20 lines
702 B
TypeScript
// apps/edr-freight-api/src/data-source.ts
|
|
import { DataSource } from 'typeorm';
|
|
//import { ensurePostgresSchemas } from './utils/ensure-postgres-schemas'; // adjust path if needed
|
|
|
|
export const AppDataSource = new DataSource({
|
|
type: 'postgres',
|
|
host: 'localhost',
|
|
port: 5432,
|
|
username: 'postgres',
|
|
password: '', // Laragon default: empty
|
|
database: 'edr_freight',
|
|
schema: 'freight', // default schema for entities without an explicit schema
|
|
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
|
migrations: [__dirname + '/migrations/*{.ts,.js}'],
|
|
synchronize: false,
|
|
logging: true,
|
|
});
|
|
|
|
// Optional: call ensurePostgresSchemas before initializing
|
|
// But you can also run it separately.
|