@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 +1 -1
- package/src/index.ts +4 -1
- package/src/models/index.ts +1 -0
package/package.json
CHANGED
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
|
|
package/src/models/index.ts
CHANGED
|
@@ -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);
|