@simitgroup/simpleapp-generator 2.0.0-s-alpha → 2.0.0-t-alpha

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.
package/ReleaseNote.md CHANGED
@@ -1,3 +1,7 @@
1
+ [2.0.0t-alpha]
2
+ 1. Fix maintenance cannot execute update script
3
+
4
+
1
5
  [2.0.0r-alpha]
2
6
  1. Fix Developer Portal
3
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simitgroup/simpleapp-generator",
3
- "version": "2.0.0s-alpha",
3
+ "version": "2.0.0t-alpha",
4
4
  "description": "frontend nuxtjs and backend nests code generator using jsonschema",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -6,14 +6,17 @@
6
6
  */
7
7
 
8
8
  import { BadRequestException, Injectable, InternalServerErrorException } from '@nestjs/common';
9
- import { Model } from 'mongoose';
10
- import { InjectModel } from '@nestjs/mongoose';
9
+ import { InjectConnection, InjectModel } from '@nestjs/mongoose';
10
+ import { Connection, Model } from 'mongoose';
11
+ import { UserContext } from 'src/simple-app/_core/features/user-context/user.context';
11
12
  import * as dbupdate from 'src/simple-app/config/db-update';
12
13
  import * as schemas from './schemas';
13
- import { UserContext } from 'src/simple-app/_core/features/user-context/user.context';
14
14
  @Injectable()
15
15
  export class MaintenanceService {
16
- constructor(@InjectModel('Environment') private sysEnvdoc: Model<schemas.Environment>) {
16
+ constructor(
17
+ @InjectModel('Environment') private sysEnvdoc: Model<schemas.Environment>,
18
+ @InjectConnection() private readonly connection: Connection,
19
+ ) {
17
20
  this.initEnv();
18
21
  }
19
22
 
@@ -50,7 +53,7 @@ export class MaintenanceService {
50
53
  async runUpdates(appuser: UserContext, versionId: string) {
51
54
  try {
52
55
  if (dbupdate[versionId]) {
53
- const result = await dbupdate[versionId]().execute();
56
+ const result = await dbupdate[versionId]().execute(this.connection);
54
57
  return Promise.resolve(result);
55
58
  } else {
56
59
  throw new BadRequestException(`invalid update script ${versionId}`);