feat(db): add TypeORM migration workflow for center and guild
This commit is contained in:
16
Fabric.Backend.Guild/src/data-source.ts
Normal file
16
Fabric.Backend.Guild/src/data-source.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user