change variable name in queries

pull/2036/head
saneery 6 years ago
parent e50848e18f
commit 1d3954fc62
  1. 6
      apps/explorer/lib/explorer/chain/import/runner/staking_pools.ex
  2. 6
      apps/explorer/lib/explorer/chain/import/runner/staking_pools_delegators.ex

@ -105,7 +105,7 @@ defmodule Explorer.Chain.Import.Runner.StakingPools do
defp default_on_conflict do defp default_on_conflict do
from( from(
name in StakingPool, pool in StakingPool,
update: [ update: [
set: [ set: [
mining_address_hash: fragment("EXCLUDED.mining_address_hash"), mining_address_hash: fragment("EXCLUDED.mining_address_hash"),
@ -120,8 +120,8 @@ defmodule Explorer.Chain.Import.Runner.StakingPools do
was_banned_count: fragment("EXCLUDED.was_banned_count"), was_banned_count: fragment("EXCLUDED.was_banned_count"),
was_validator_count: fragment("EXCLUDED.was_validator_count"), was_validator_count: fragment("EXCLUDED.was_validator_count"),
is_deleted: fragment("EXCLUDED.is_deleted"), is_deleted: fragment("EXCLUDED.is_deleted"),
inserted_at: fragment("LEAST(?, EXCLUDED.inserted_at)", name.inserted_at), inserted_at: fragment("LEAST(?, EXCLUDED.inserted_at)", pool.inserted_at),
updated_at: fragment("GREATEST(?, EXCLUDED.updated_at)", name.updated_at) updated_at: fragment("GREATEST(?, EXCLUDED.updated_at)", pool.updated_at)
] ]
] ]
) )

@ -74,7 +74,7 @@ defmodule Explorer.Chain.Import.Runner.StakingPoolsDelegators do
defp default_on_conflict do defp default_on_conflict do
from( from(
name in StakingPoolsDelegator, delegator in StakingPoolsDelegator,
update: [ update: [
set: [ set: [
stake_amount: fragment("EXCLUDED.stake_amount"), stake_amount: fragment("EXCLUDED.stake_amount"),
@ -82,8 +82,8 @@ defmodule Explorer.Chain.Import.Runner.StakingPoolsDelegators do
max_withdraw_allowed: fragment("EXCLUDED.max_withdraw_allowed"), max_withdraw_allowed: fragment("EXCLUDED.max_withdraw_allowed"),
max_ordered_withdraw_allowed: fragment("EXCLUDED.max_ordered_withdraw_allowed"), max_ordered_withdraw_allowed: fragment("EXCLUDED.max_ordered_withdraw_allowed"),
ordered_withdraw_epoch: fragment("EXCLUDED.ordered_withdraw_epoch"), ordered_withdraw_epoch: fragment("EXCLUDED.ordered_withdraw_epoch"),
inserted_at: fragment("LEAST(?, EXCLUDED.inserted_at)", name.inserted_at), inserted_at: fragment("LEAST(?, EXCLUDED.inserted_at)", delegator.inserted_at),
updated_at: fragment("GREATEST(?, EXCLUDED.updated_at)", name.updated_at) updated_at: fragment("GREATEST(?, EXCLUDED.updated_at)", delegator.updated_at)
] ]
] ]
) )

Loading…
Cancel
Save