import { DataSource } from 'typeorm';
import * as dotenv from 'dotenv';

dotenv.config();
export const connectionSource = new DataSource({
  type: 'postgres',
  host: process.env.DEFAULT_DB_HOST,
  port: parseInt(process.env.DEFAULT_DB_PORT),
  username: process.env.DEFAULT_DB_USER,
  password: process.env.DEFAULT_DB_PASS,
  database: process.env.DEFAULT_DB_NAME,
  entities: [
    'src/modules/**/**/data/models/*.ts',
    'src/modules/reports/shared/models/*.ts',
  ],
  migrationsTableName: 'migrations',
  migrations: ['src/database/migrations/*.ts'],
  synchronize: false,
});
