@ccci/micro-server 1.0.237 → 1.0.239

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/dist/index.js CHANGED
@@ -293172,17 +293172,17 @@ class DatabaseConnector {
293172
293172
  static getModel(modelName) {
293173
293173
  return DatabaseConnector.connection.models[modelName];
293174
293174
  }
293175
- static async sync(modelName, force = false) {
293175
+ static async sync(modelName, force = false, alter = false) {
293176
293176
  try {
293177
293177
  Logger.info("Syncing Database table: ", modelName);
293178
- await DatabaseConnector.connection.models[modelName].sync({ force });
293178
+ await DatabaseConnector.connection.models[modelName].sync({ force, alter });
293179
293179
  } catch (error) {
293180
293180
  Logger.error(error);
293181
293181
  }
293182
293182
  }
293183
- static async syncAll(force = false) {
293183
+ static async syncAll(force = false, alter = false) {
293184
293184
  try {
293185
- await DatabaseConnector.connection.sync({ force });
293185
+ await DatabaseConnector.connection.sync({ force, alter });
293186
293186
  } catch (error) {
293187
293187
  Logger.error(error);
293188
293188
  }
@@ -299475,6 +299475,7 @@ class BaseController {
299475
299475
  let response4 = null;
299476
299476
  if (!response4) {
299477
299477
  response4 = await this._model?.findAndCountAll({
299478
+ distinct: true,
299478
299479
  where: options.where,
299479
299480
  limit: options.limit,
299480
299481
  offset: options.offset,
@@ -10,6 +10,7 @@ export default class BaseController {
10
10
  /**
11
11
  * Find all the rows matching your query, within a specified offset / limit,
12
12
  * and get the total number of rows matching your query.
13
+ * -- added distinct:true
13
14
  * ```js
14
15
  * Controller.find(req, res, next)
15
16
  * ```
@@ -19,8 +19,8 @@ export default class DatabaseConnector {
19
19
  static getConnection(): Sequelize;
20
20
  connect(connection: Sequelize): Promise<void>;
21
21
  static getModel(modelName: string): ModelStatic<Model>;
22
- static sync(modelName: string, force?: boolean): Promise<void>;
23
- static syncAll(force?: boolean): Promise<void>;
22
+ static sync(modelName: string, force?: boolean, alter?: boolean): Promise<void>;
23
+ static syncAll(force?: boolean, alter?: boolean): Promise<void>;
24
24
  static disconnect(): void;
25
25
  }
26
26
  //# sourceMappingURL=DatabaseConnector.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.237",
3
+ "version": "1.0.239",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",