Fix some issues with Credo and Dialyzer.

pull/42/head
CJ Bryan and Desmond Bowe 7 years ago
parent e12b13bc5b
commit c82d7ea79a
  1. 2
      .sobelow-conf
  2. 2
      lib/explorer/schemas/schema.ex
  3. 14
      lib/giant_address_migrator.ex

@ -6,5 +6,5 @@
exit: "low",
format: "compact",
ignore: ["Config.CSRF", "Vuln.Coherence"],
ignore_files: [""]
ignore_files: ["lib/giant_address_migrator.ex"]
]

@ -1,4 +1,6 @@
defmodule Explorer.Schema do
@moduledoc "Common configuration for Explorer schemas."
defmacro __using__(_opts) do
quote do
use Ecto.Schema

@ -1,11 +1,17 @@
defmodule GiantAddressMigrator do
@moduledoc "Migrate away from Address join tables."
require Logger
alias Explorer.Repo
def migrate do
for n <- 1..20 do
chunk_size = 500_000
lower = n * chunk_size - chunk_size
upper = n * chunk_size
IO.inspect("fetching results between #{lower} and #{upper}")
Logger.info("fetching results between #{lower} and #{upper}")
work_on_transactions_between_ids(lower, upper)
end
end
@ -20,8 +26,8 @@ defmodule GiantAddressMigrator do
;
"""
{:ok, result} = Explorer.Repo.query(query, [])
IO.inspect("got em!")
{:ok, result} = Repo.query(query, [])
Logger.info("got em!")
result.rows
|> Enum.each(&sweet_update/1)
@ -32,7 +38,7 @@ defmodule GiantAddressMigrator do
UPDATE transactions SET from_address_id = $1, to_address_id = $2 WHERE id = $3
"""
{:ok, status} = Explorer.Repo.query(query, [from_address_id, to_address_id, transaction_id])
{:ok, _status} = Repo.query(query, [from_address_id, to_address_id, transaction_id])
end
def sweet_update(_), do: nil

Loading…
Cancel
Save