From 37c16ecf9fd64fc7644e82d8619584d0f64d694e Mon Sep 17 00:00:00 2001 From: Kapil Viren Ahuja Date: Thu, 30 Mar 2017 21:34:58 +0530 Subject: Pushed shard_id to all the tables as shard + api_id is the unique combination --- worker.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'worker.js') diff --git a/worker.js b/worker.js index a563562..3c51624 100644 --- a/worker.js +++ b/worker.js @@ -60,13 +60,18 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost", await match.rosters.forEach(async (roster) => { roster.match_api_id = match.api_id; + roster.shard_id = match.shard_id; await model.Roster.upsert(roster, { include: [ model.Participant/*, model.Team*/ ] }); await roster.participants.forEach(async (participant) => { + participant.shard_id = roster.shard_id; + participant.player.shard_id = participant.shard_id; + await model.Player.upsert(participant.player); + participant.roster_api_id = roster.api_id; participant.player_api_id = participant.player.api_id; await model.Participant.upsert(participant, { -- cgit v1.3.1