17 lines
445 B
TypeScript
17 lines
445 B
TypeScript
import 'reflect-metadata';
|
|
import { DataSource, DataSourceOptions } from 'typeorm';
|
|
import { buildTypeOrmConfig } from './database.config';
|
|
|
|
const cfg = buildTypeOrmConfig();
|
|
|
|
const options: DataSourceOptions = {
|
|
...(cfg as Record<string, unknown>),
|
|
type: 'mysql',
|
|
migrations: ['src/migrations/*.{ts,js}'],
|
|
synchronize: false,
|
|
} as DataSourceOptions;
|
|
|
|
export const AppDataSource = new DataSource(options);
|
|
|
|
export default AppDataSource;
|