nails-boilerplate 1.3.0 → 1.3.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.
package/lib/nails.js CHANGED
@@ -20,6 +20,7 @@ import ModelV2 from './model_v2.js';
20
20
  import Router from './router.js';
21
21
 
22
22
  import express_app from './application.js';
23
+ import DbConnector from './database_connector.js';
23
24
 
24
25
  const models = {};
25
26
 
@@ -81,7 +82,7 @@ async function configure( app_config ) {
81
82
  }
82
83
  // TODO: make this Model style mandatory
83
84
  console.log("Connecting to DB...");
84
- if (DBConnector.connect && DBConnector.generateModelSuperclass) {
85
+ if (DBConnector instanceof DbConnector) {
85
86
  console.log("Generating model superclass...");
86
87
  await DBConnector.connect(app_config.db);
87
88
  ModelV2.setConnector(DBConnector);
@@ -20,6 +20,7 @@ export default class SequelizeConnector extends DbConnector {
20
20
  }
21
21
 
22
22
  async afterInitialization() {
23
- this.sequelize.sync({alter: true});
23
+ console.log("SEQUELIZE::Writing changes to SQL Database");
24
+ await this.sequelize.sync({alter: true});
24
25
  }
25
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nails-boilerplate",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A node.js webserver scaffold",
5
5
  "type": "module",
6
6
  "main": "index.js",