Skip to content

Commit

Permalink
fix: consider HUB_ID when seeding the hub (#1073)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalinkrustev authored Jul 26, 2024
1 parent 2cc0af6 commit ba1188d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 9 deletions.
53 changes: 47 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"@hapi/vision": "7.0.3",
"@mojaloop/central-services-error-handling": "13.0.1",
"@mojaloop/central-services-health": "15.0.0",
"@mojaloop/central-services-logger": "11.3.1",
"@mojaloop/central-services-logger": "11.5.0",
"@mojaloop/central-services-metrics": "12.0.8",
"@mojaloop/central-services-shared": "18.6.3",
"@mojaloop/central-services-stream": "11.3.1",
Expand Down
3 changes: 2 additions & 1 deletion seeds/participant.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const Config = require('../src/lib/config')

const participant = [
{
participantId: Config.HUB_ID,
name: Config.HUB_NAME,
description: 'Hub Operator',
createdBy: 'seeds'
Expand All @@ -36,7 +37,7 @@ const participant = [

exports.seed = async function (knex) {
try {
return await knex('participant').insert(participant).onConflict('name').ignore()
return await knex('participant').insert(participant).onConflict('id').merge()
} catch (err) {
console.log(`Uploading seeds for participant has failed with the following error: ${err}`)
return -1000
Expand Down
2 changes: 1 addition & 1 deletion test/unit/seeds/participant.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Test('Participant ', async (participantTest) => {
knexStub.returns({
insert: sandbox.stub().returns({
onConflict: sandbox.stub().returns({
ignore: sandbox.stub().returns(true)
merge: sandbox.stub().returns(true)
})
})
})
Expand Down

0 comments on commit ba1188d

Please sign in to comment.