@verdnatura/myt 1.5.13 → 1.5.14

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.
Files changed (2) hide show
  1. package/myt-push.js +14 -11
  2. package/package.json +1 -1
package/myt-push.js CHANGED
@@ -267,8 +267,7 @@ class Push extends Command {
267
267
  const gitExists = await fs.pathExists(`${opts.workspace}/.git`);
268
268
 
269
269
  let nRoutines = 0;
270
- let changes = await this.changedRoutines(version.gitCommit);
271
- changes = this.parseChanges(changes);
270
+ const changes = await this.changedRoutines(version.gitCommit);
272
271
 
273
272
  const routines = [];
274
273
  for (const change of changes)
@@ -397,14 +396,6 @@ class Push extends Command {
397
396
  await pushConn.end();
398
397
  }
399
398
 
400
- parseChanges(changes) {
401
- const routines = [];
402
- if (changes)
403
- for (const change of changes)
404
- routines.push(new Routine(change));
405
- return routines;
406
- }
407
-
408
399
  async updateVersion(column, value) {
409
400
  column = SqlString.escapeId(column, true);
410
401
  await this.conn.query(
@@ -478,9 +469,21 @@ class Push extends Command {
478
469
  await pushChanges(await repoExt.getUnstaged(repo));
479
470
  await pushChanges(await repoExt.getStaged(repo));
480
471
 
481
- return changes.sort((a, b) => {
472
+ const routines = [];
473
+ for (const change of changes)
474
+ routines.push(new Routine(change));
475
+
476
+ return routines.sort((a, b) => {
482
477
  if (b.mark != a.mark)
483
478
  return b.mark == '-' ? 1 : -1;
479
+
480
+ if (b.type.name !== a.type.name) {
481
+ if (b.type.name == 'VIEW')
482
+ return -1;
483
+ if (a.type.name == 'VIEW')
484
+ return 1;
485
+ }
486
+
484
487
  return a.path.localeCompare(b.path);
485
488
  });
486
489
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdnatura/myt",
3
- "version": "1.5.13",
3
+ "version": "1.5.14",
4
4
  "author": "Verdnatura Levante SL",
5
5
  "description": "MySQL version control",
6
6
  "license": "GPL-3.0",