@mlagie/sql-connector 1.0.3-beta → 1.0.4-beta

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/index.js +1 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -331,7 +331,7 @@ class Model {
331
331
  const field = schema[fieldName];
332
332
  let lengthDefault = 255;
333
333
 
334
- if (!field.type && typeof field == "object") throw new Error(`Field ${fieldName} has no type defined.`);
334
+ if (!field.type && typeof field == "object" && !(Array.isArray(field.enum) && field.enum.length > 0)) throw new Error(`Field ${fieldName} has no type defined.`);
335
335
 
336
336
  const fieldType = getFieldType(field);
337
337
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlagie/sql-connector",
3
- "version": "1.0.3-beta",
3
+ "version": "1.0.4-beta",
4
4
  "description": "Le module sql-connector permet de gérer les connexions à une base de données MySQL, de définir des schémas de tables, et d'interagir avec les données de manière simple et efficace.",
5
5
  "main": "index.js",
6
6
  "scripts": {