const { DataSource } = require('typeorm'); const { join } = require('path'); require('dotenv').config({ path: join(__dirname, './factory-env/.env.global.development'), }); const dataSource = new DataSource({ type: 'postgres', host: process.env.POSTGRESQL_ENDPOINT, port: 5432, username: process.env.POSTGRESQL_USER, password: process.env.POSTGRESQL_PASSWORD, database: process.env.POSTGRESQL_INIT_DB, ssl: { rejectUnauthorized: false }, entities: [ 'src/submodule/factory-types/src/entity/**/*.entity.ts', 'src/submodule/factory-types/src/entity/**/*.ts', ], migrations: ['src/migrations/*.ts'], migrationsTableName: 'migrations_history', }); module.exports = dataSource;