mythix 2.0.0 → 2.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mythix",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "Mythix is a NodeJS web-app framework",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -20,9 +20,9 @@
20
20
  "homepage": "https://github.com/th317erd/mythix#readme",
21
21
  "devDependencies": {
22
22
  "@spothero/eslint-plugin-spothero": "github:spothero/eslint-plugin-spothero",
23
- "eslint": "^8.13.0",
24
23
  "colors": "^1.4.0",
25
24
  "diff": "^5.1.0",
25
+ "eslint": "^8.13.0",
26
26
  "jasmine": "^4.0.2"
27
27
  },
28
28
  "dependencies": {
@@ -30,7 +30,8 @@
30
30
  "express": "^4.17.3",
31
31
  "express-busboy": "^8.0.2",
32
32
  "form-data": "^4.0.0",
33
- "nife": "^1.8.1",
33
+ "mythix-orm": "^1.0.4",
34
+ "nife": "^1.11.3",
34
35
  "prompts": "^2.4.2"
35
36
  }
36
37
  }
@@ -61,18 +61,18 @@ module.exports = defineCommand('migrate', ({ Parent }) => {
61
61
  return migrationFiles.slice((isRollback) ? index : index + 1);
62
62
  }
63
63
 
64
- async executeMigration(dbConnection, migrationFileName, useTransaction, rollback) {
64
+ async executeMigration(application, dbConnection, migrationFileName, useTransaction, rollback) {
65
65
  let migration = require(migrationFileName);
66
66
  let startTime = Nife.now();
67
67
 
68
68
  if (rollback) {
69
- await migration.down(dbConnection);
69
+ await migration.down(dbConnection, application);
70
70
  await this.removeMigrationFromDB(migration.MIGRATION_ID);
71
71
 
72
72
  let seconds = ((Nife.now() - startTime) / MILLISECONDS_PER_SECOND).toFixed(2);
73
73
  console.log(`Rolled back migration ${migrationFileName} successfully in ${seconds} seconds`);
74
74
  } else {
75
- await migration.up(dbConnection);
75
+ await migration.up(dbConnection, application);
76
76
  await this.storeSuccessfulMigrationToDB(migration.MIGRATION_ID);
77
77
 
78
78
  let seconds = ((Nife.now() - startTime) / MILLISECONDS_PER_SECOND).toFixed(2);
@@ -130,7 +130,7 @@ module.exports = defineCommand('migrate', ({ Parent }) => {
130
130
  else
131
131
  console.log(`Running migration ${migrationFileName}...`);
132
132
 
133
- this.executeMigration(dbConnection, migrationFileName, useTransaction, rollback).then(
133
+ this.executeMigration(application, dbConnection, migrationFileName, useTransaction, rollback).then(
134
134
  () => nextMigration(doneCallback, index + 1),
135
135
  (error) => {
136
136
  console.error(`Error while running migration ${migrationFileName}: `, error);
@@ -175,7 +175,7 @@ class HTTPServer {
175
175
  () => rootNext(),
176
176
  (error) => {
177
177
  if (!(error instanceof HTTPBaseError))
178
- this.getApplication().error('Error in middleware: ', error);
178
+ this.getApplication().getLogger().error('Error in middleware: ', error);
179
179
  },
180
180
  );
181
181
  }