@autofleet/sadot 0.13.2-beta.2 → 0.13.2-beta.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": "@autofleet/sadot",
3
- "version": "0.13.2-beta.2",
3
+ "version": "0.13.2-beta.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -37,7 +37,10 @@ const useCustomFields = async (
37
37
  }
38
38
  // The order is important
39
39
  addHooks(models, getModel, { useCustomFieldsEntries });
40
- await initTables(sequelize, options.getUser, { useCustomFieldsEntries });
40
+ await initTables(sequelize, options.getUser, { useCustomFieldsEntries }).catch((e) => {
41
+ logger.error('sadot - error while initializing custom fields tables', e);
42
+ throw e;
43
+ });
41
44
  addScopes(models, getModel, { useCustomFieldsEntries });
42
45
  applyCustomAssociation(models);
43
46
 
@@ -104,6 +104,7 @@ const initTables = async (
104
104
  },
105
105
  );
106
106
 
107
+ logger.info('custom-fields: starting migrations');
107
108
  const migrations = await SequelizeMeta.findAll({ where: { name: { [Op.like]: `${schemaPrefix}%` } }, raw: true });
108
109
  const currentSadotSchemaVersion = migrations.at(-1);
109
110
  const expectedSchemaVersionIndex = migrations.findIndex((m) => (m as any).name === CUSTOM_FIELDS_SCHEMA_VERSION);