From f12c6cbb0fbcfa9399b620da1e90d569ddd3a938 Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Fri, 19 Jul 2024 11:17:05 +0200 Subject: [PATCH] Fix/service agreement prunning migration fix (#3250) * Fix missing return in getCountOfServiceAgreementsByBlockchainAndContract * Add commnet for removeServiceAgreementsByBlockchainAndContract * Version bump --- package-lock.json | 4 ++-- package.json | 2 +- .../sequelize/repositories/service-agreement-repository.js | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4004d3ae08..4e48f8bd34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.5.1+hotfix.1", + "version": "6.5.1+hotfix.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.5.1+hotfix.1", + "version": "6.5.1+hotfix.2", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", diff --git a/package.json b/package.json index e72debf9c8..4b5d7d5a67 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.5.1+hotfix.1", + "version": "6.5.1+hotfix.2", "description": "OTNode V6", "main": "index.js", "type": "module", diff --git a/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js b/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js index 1c3a6725c7..c8fbdc56b5 100644 --- a/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js +++ b/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js @@ -288,7 +288,7 @@ class ServiceAgreementRepository { } async getCountOfServiceAgreementsByBlockchainAndContract(blockchainId, contract) { - await this.model.count({ + return this.model.count({ where: { blockchainId, assetStorageContractAddress: { @@ -298,6 +298,7 @@ class ServiceAgreementRepository { }); } + // Sequelize destroy method doesn't support limit async removeServiceAgreementsByBlockchainAndContract(blockchainId, contract) { const query = ` DELETE FROM service_agreement