@midwayjs/typeorm 4.0.0-beta.1 → 4.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,7 +71,9 @@ exports.OrmConfiguration = OrmConfiguration = __decorate([
71
71
  importConfigs: [
72
72
  {
73
73
  default: {
74
- typeorm: {},
74
+ typeorm: {
75
+ allowExecuteMigrations: false,
76
+ },
75
77
  midwayLogger: {
76
78
  clients: {
77
79
  typeormLogger: {
@@ -1,7 +1,8 @@
1
1
  import { DataSourceManager, IMidwayContainer, MidwayLoggerService } from '@midwayjs/core';
2
2
  import { DataSource } from 'typeorm';
3
+ import { typeormConfigOptions } from './interface';
3
4
  export declare class TypeORMDataSourceManager extends DataSourceManager<DataSource> {
4
- typeormConfig: any;
5
+ typeormConfig: typeormConfigOptions;
5
6
  applicationContext: IMidwayContainer;
6
7
  loggerService: MidwayLoggerService;
7
8
  init(): Promise<void>;
@@ -23,8 +23,10 @@ let TypeORMDataSourceManager = class TypeORMDataSourceManager extends core_1.Dat
23
23
  return 'typeorm';
24
24
  }
25
25
  async createDataSource(config, dataSourceName) {
26
- if (config['migrations']) {
27
- delete config['migrations'];
26
+ if (!this.typeormConfig['allowExecuteMigrations']) {
27
+ if (config['migrations']) {
28
+ delete config['migrations'];
29
+ }
28
30
  }
29
31
  if (config['logging'] === undefined) {
30
32
  config['logger'] = new logger_1.TypeORMLogger(this.loggerService.getLogger('typeormLogger'));
@@ -1,4 +1,6 @@
1
1
  import { DataSourceOptions } from 'typeorm';
2
2
  import { DataSourceManagerConfigOption } from '@midwayjs/core';
3
- export type typeormConfigOptions = DataSourceManagerConfigOption<DataSourceOptions>;
3
+ export type typeormConfigOptions = DataSourceManagerConfigOption<DataSourceOptions> & {
4
+ allowExecuteMigrations: boolean;
5
+ };
4
6
  //# sourceMappingURL=interface.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/typeorm",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.2",
4
4
  "main": "dist/index.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -13,8 +13,8 @@
13
13
  "index.d.ts"
14
14
  ],
15
15
  "devDependencies": {
16
- "@midwayjs/core": "^4.0.0-beta.1",
17
- "@midwayjs/mock": "^4.0.0-beta.1",
16
+ "@midwayjs/core": "^4.0.0-beta.2",
17
+ "@midwayjs/mock": "^4.0.0-beta.2",
18
18
  "sqlite3": "5.1.7",
19
19
  "typeorm": "0.3.20"
20
20
  },
@@ -23,7 +23,7 @@
23
23
  "email": "czy88840616@gmail.com"
24
24
  },
25
25
  "engines": {
26
- "node": ">=12"
26
+ "node": ">=20"
27
27
  },
28
28
  "license": "MIT",
29
29
  "scripts": {
@@ -35,5 +35,5 @@
35
35
  "type": "git",
36
36
  "url": "https://github.com/midwayjs/midway.git"
37
37
  },
38
- "gitHead": "832961ec3aff123c033197d8c00cb2bc9bad7ff8"
38
+ "gitHead": "53bfef4c5279da5f09025e4610bdbf64f94f60bd"
39
39
  }