@keltoi/hydra 2.3.6 → 2.3.9

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 +13 -10
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -249,8 +249,8 @@ class Status extends Entity{
249
249
  )
250
250
  }
251
251
 
252
- constructor({ id=1, description=''}){
253
- super({ id }, { status:description });
252
+ constructor({ id=1, description='', data={}}){
253
+ super({ id }, { status:description, ...data });
254
254
  }
255
255
 
256
256
  get description(){ return this.data.status }
@@ -365,19 +365,22 @@ class Migration{
365
365
  })
366
366
 
367
367
  async runMigrations({ entity = Entity, migrations=[async ()=>{}] }){
368
- const name = entity.name;
368
+ try{
369
+ const name = entity.name;
369
370
 
370
- const { iteration } = await this.#get({ name });
371
+ const { iteration } = await this.#get({ name });
371
372
 
372
- const listSize = migrations.length;
373
+ const listSize = migrations.length;
373
374
 
374
- if (iteration >= listSize) return
375
+ if (iteration >= listSize) return
375
376
 
376
- for (let index = iteration; index < listSize; index++)
377
- await migrations[index]()
378
- .catch(err=>console.log(err));
377
+ for (let index = iteration; index < listSize; index++) await migrations[index]();
379
378
 
380
- await this.#update({ iteration:listSize,name });
379
+ await this.#update({ iteration:listSize,name });
380
+ } catch(err){
381
+
382
+ console.error(err);
383
+ }
381
384
  }
382
385
 
383
386
  static structMe(db=knex()){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keltoi/hydra",
3
- "version": "2.3.6",
3
+ "version": "2.3.9",
4
4
  "description": "Boilerplate to start your API from zero using Repository Pattern",
5
5
  "main": "index.js",
6
6
  "module": "index.js",