@ccci/micro-server 1.0.235 → 1.0.237

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/dist/index.js +13 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -299696,30 +299696,30 @@ class BaseModel extends Model {
299696
299696
  comment: tableOption,
299697
299697
  timestamps: defaultAttributes ? defaultAttributes : true
299698
299698
  };
299699
- enableDefaultFields = defaultAttributes ? defaultAttributes : true;
299699
+ if (defaultAttributes != null && !defaultAttributes) {
299700
+ enableDefaultFields = false;
299701
+ initOptions.paranoid = false;
299702
+ initOptions.timestamps = false;
299703
+ } else {
299704
+ enableDefaultFields = true;
299705
+ }
299700
299706
  } else {
299701
299707
  initOptions = {
299702
299708
  sequelize: DatabaseConnector.getConnection(),
299703
299709
  tableName: tableOption.tableName,
299704
299710
  schema: tableOption.schema || process.env.DB_SCHEMA,
299705
- paranoid: tableOption.paranoid ? Boolean(tableOption.paranoid) : true,
299711
+ paranoid: tableOption.paranoid != null && !tableOption.paranoid ? tableOption.paranoid : true,
299706
299712
  comment: tableOption.comment ? tableOption.comment : tableOption.tableName,
299707
- timestamps: tableOption.defaultAttributes ? Boolean(tableOption.defaultAttributes) : true
299713
+ timestamps: true
299708
299714
  };
299709
- if (tableOption.defaultAttributes) {
299710
- console.log("existing :>> ", tableOption.defaultAttributes);
299711
- enableDefaultFields = tableOption.defaultAttributes;
299712
- console.log("enableDefaultFields :>> ", enableDefaultFields);
299715
+ if (tableOption.defaultAttributes != null && !tableOption.defaultAttributes) {
299716
+ enableDefaultFields = false;
299717
+ initOptions.paranoid = false;
299718
+ initOptions.timestamps = false;
299713
299719
  } else {
299714
299720
  enableDefaultFields = true;
299715
299721
  }
299716
299722
  }
299717
- if (initOptions.tableName === "Users") {
299718
- Logger.info("tableOption :>> ", tableOption);
299719
- Logger.info("initOptions.timestamps :>> ", initOptions.timestamps);
299720
- Logger.info("initOptions.paranoid :>> ", initOptions.paranoid);
299721
- Logger.info("enableDefaultFields :>> ", enableDefaultFields);
299722
- }
299723
299723
  this.init({
299724
299724
  ...fields,
299725
299725
  ...this.getCommonAttributes(enableDefaultFields)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.235",
3
+ "version": "1.0.237",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",