gina-sequelize 0.0.14 → 0.0.15

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/bin/index.ts +10 -1
  2. package/package.json +1 -1
package/bin/index.ts CHANGED
@@ -150,7 +150,16 @@ async function generateMigration(migrationName) {
150
150
  async function upgrade() {
151
151
  try {
152
152
  const pathName = process.cwd();
153
- const initFile = await import(pathName + '/gina/initializeModels.ts');
153
+
154
+ const ginaFolder = (await readdir(pathName + '/gina')).filter(file => !file.includes('.d.ts') && !file.includes('.js.map'));
155
+
156
+ let initializeModelsFile = 'initializeModels.ts';
157
+
158
+ if (ginaFolder.includes('initializeModels.js')) {
159
+ initializeModelsFile = 'initializeModels.js';
160
+ }
161
+
162
+ const initFile = await import(pathName + '/gina/' + initializeModelsFile);
154
163
 
155
164
  console.log('loading models...');
156
165
  let initializeModels = initFile.initializeModels;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "gina-cli": "./bin/index.ts"
6
6
  },
7
7
  "types": "./dist/gina.d.ts",
8
- "version": "0.0.14",
8
+ "version": "0.0.15",
9
9
  "description": "Gina is a tool to auto-generate and run migrations based on Sequelize ORM.",
10
10
  "scripts": {
11
11
  "eslint": "eslint .",