-
Notifications
You must be signed in to change notification settings - Fork 0
/
ormconfig.ts
27 lines (24 loc) · 1.02 KB
/
ormconfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* eslint-disable prettier/prettier */
import { SqliteConnectionOptions } from 'typeorm/driver/sqlite/SqliteConnectionOptions';
const defaultConfig: SqliteConnectionOptions = {
type: 'sqlite',
database: 'db',
entities: ['dist/src/**/*.entity.js'],
synchronize: true, // TODO set to false
migrations: ['dist/src/db/migrations/*.js'],
cli: {
migrationsDir: 'src/db/migrations',
},
};
// Four different database connections / schemas.
export const config1: SqliteConnectionOptions = { ...defaultConfig, database: 'db1' };
export const config2: SqliteConnectionOptions = { ...defaultConfig, database: 'db2', name: 'schema2' };
export const config3: SqliteConnectionOptions = { ...defaultConfig, database: 'db3', name: 'schema3' };
export const config4: SqliteConnectionOptions = { ...defaultConfig, database: 'db4', name: 'schema4' };
export const testConfig: SqliteConnectionOptions = {
type: 'sqlite',
database: ':memory:',
dropSchema: true,
entities: ['dist/src/**/*.entity.js'],
synchronize: true,
};