gg-mysql-connector 1.0.96 → 1.0.97

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.
@@ -227,6 +227,7 @@ class MyDBMigrator {
227
227
  async migrateView_v2(viewModel) {
228
228
  let unSuccessUpdateViewList = viewModel;
229
229
  let loopCount = 0;
230
+ let lastUnUpdateViewCount = unSuccessUpdateViewList.length;
230
231
  while (unSuccessUpdateViewList.length > 0) {
231
232
  for (const viewRow of unSuccessUpdateViewList) {
232
233
  const content = viewRow.sqlStatement;
@@ -243,10 +244,18 @@ class MyDBMigrator {
243
244
  console.log("");
244
245
  });
245
246
  }
246
- if (loopCount > viewModel.length * 5) {
247
- console.error("error while updating view, reason is loop update counter is over 5 time fail");
247
+ if (lastUnUpdateViewCount === unSuccessUpdateViewList.length) {
248
+ console.error("error no view update success");
248
249
  process.exit(1);
249
250
  }
251
+ else
252
+ lastUnUpdateViewCount = unSuccessUpdateViewList.length;
253
+ // if (loopCount > viewModel.length * 5) {
254
+ // console.error(
255
+ // "error while updating view, reason is loop update counter is over 5 time fail"
256
+ // )
257
+ // process.exit(1)
258
+ // }
250
259
  loopCount++;
251
260
  }
252
261
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gg-mysql-connector",
3
- "version": "1.0.96",
3
+ "version": "1.0.97",
4
4
  "description": "",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {
@@ -354,6 +354,7 @@ export default class MyDBMigrator {
354
354
  public async migrateView_v2(viewModel: MyViewModel[]) {
355
355
  let unSuccessUpdateViewList: MyViewModel[] = viewModel
356
356
  let loopCount = 0
357
+ let lastUnUpdateViewCount = unSuccessUpdateViewList.length
357
358
  while (unSuccessUpdateViewList.length > 0) {
358
359
  for (const viewRow of unSuccessUpdateViewList) {
359
360
  const content = viewRow.sqlStatement
@@ -374,12 +375,16 @@ export default class MyDBMigrator {
374
375
  console.log("")
375
376
  })
376
377
  }
377
- if (loopCount > viewModel.length * 5) {
378
- console.error(
379
- "error while updating view, reason is loop update counter is over 5 time fail"
380
- )
378
+ if (lastUnUpdateViewCount === unSuccessUpdateViewList.length) {
379
+ console.error("error no view update success")
381
380
  process.exit(1)
382
- }
381
+ } else lastUnUpdateViewCount = unSuccessUpdateViewList.length
382
+ // if (loopCount > viewModel.length * 5) {
383
+ // console.error(
384
+ // "error while updating view, reason is loop update counter is over 5 time fail"
385
+ // )
386
+ // process.exit(1)
387
+ // }
383
388
  loopCount++
384
389
  }
385
390
  }