Skip to content

Commit 568de78

Browse files
committed
fix: make data source usable with the typeorm cli
1 parent 1182375 commit 568de78

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ormconfig.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { existsSync } from 'fs';
2-
import type { DataSourceOptions } from 'typeorm';
2+
import {DataSource, DataSourceOptions} from 'typeorm';
33
import { SnakeNamingStrategy } from 'typeorm-naming-strategies';
44

55
import './src/util/dotenv';
@@ -39,3 +39,6 @@ if (existsSync('./ormconfig.local.ts'))
3939
}
4040

4141
export default ormConfig;
42+
43+
// Also export the data source as an object for use with the typeorm cli
44+
export const dataSource = new DataSource(ormConfig);

0 commit comments

Comments
 (0)