Files
PluralFlux/database/data-source.ts

23 lines
638 B
TypeScript
Raw Normal View History

2026-03-01 10:20:43 -05:00
import "reflect-metadata"
import { DataSource } from "typeorm"
import * as env from 'dotenv';
env.config();
export const AppDataSource = new DataSource({
type: "postgres",
host: "localhost",
port: 5432,
username: "postgres",
password: process.env.POSTGRES_PASSWORD,
database: "postgres",
2026-03-01 11:42:55 -05:00
synchronize: false,
2026-03-01 10:20:43 -05:00
logging: false,
2026-03-01 11:42:55 -05:00
migrations: [__dirname + '/migration/**/*{.js,.ts}'],
entities: ["dist/entities/**/*.js"], // Point to compiled JS files
subscribers: ["dist/subscribers/**/*.js"],
migrationsRun: true,
migrationsTableName: 'migrations',
migrationsTransactionMode: 'all'
2026-03-01 10:20:43 -05:00
})