@midwayjs/sequelize 3.6.0 → 3.7.1

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.
@@ -18,6 +18,7 @@ let SequelizeConfiguration = class SequelizeConfiguration {
18
18
  this.decoratorService.registerPropertyHandler(decorator_1.ENTITY_MODEL_KEY, (propertyName, meta) => {
19
19
  return this.dataSourceManager
20
20
  .getDataSource(meta.connectionName ||
21
+ this.dataSourceManager.getDefaultDataSourceName() ||
21
22
  this.dataSourceManager.getDataSourceNameByModel(meta.modelKey))
22
23
  .getRepository(meta.modelKey);
23
24
  });
@@ -30,7 +30,7 @@ let SequelizeDataSourceManager = class SequelizeDataSourceManager extends core_1
30
30
  client.addModels(listEntities);
31
31
  await client.authenticate();
32
32
  if (config.sync) {
33
- await client.sync();
33
+ await client.sync(config.syncOptions);
34
34
  }
35
35
  this.coreLogger.info('[midway:sequelize] connecting and start');
36
36
  return client;
@@ -1,6 +1,8 @@
1
1
  import { DataSourceManagerConfigOption } from '@midwayjs/core';
2
2
  import { SequelizeOptions } from 'sequelize-typescript';
3
+ import { SyncOptions } from 'sequelize';
3
4
  export declare type SequelizeConfigOptions = DataSourceManagerConfigOption<SequelizeOptions & {
4
5
  sync?: boolean;
6
+ syncOptions?: SyncOptions;
5
7
  }>;
6
8
  //# sourceMappingURL=interface.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/sequelize",
3
- "version": "3.6.0",
3
+ "version": "3.7.1",
4
4
  "main": "dist/index",
5
5
  "typings": "index.d.ts",
6
6
  "files": [
@@ -9,13 +9,13 @@
9
9
  "index.d.ts"
10
10
  ],
11
11
  "devDependencies": {
12
- "@midwayjs/core": "^3.6.0",
13
- "@midwayjs/koa": "^3.6.0",
14
- "@midwayjs/mock": "^3.6.0",
12
+ "@midwayjs/core": "^3.7.0",
13
+ "@midwayjs/koa": "^3.7.1",
14
+ "@midwayjs/mock": "^3.7.1",
15
15
  "sqlite3": "5.1.2"
16
16
  },
17
17
  "dependencies": {
18
- "sequelize": "6.24.0",
18
+ "sequelize": "6.25.3",
19
19
  "sequelize-typescript": "^2.1.0"
20
20
  },
21
21
  "keywords": [
@@ -40,5 +40,5 @@
40
40
  "type": "git",
41
41
  "url": "http://github.com/midwayjs/midway.git"
42
42
  },
43
- "gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
43
+ "gitHead": "d41be2f6082d035ea4fb109e32b0e240c2435f9a"
44
44
  }