# `EctoDoctor.Finding`
[🔗](https://github.com/Daniel-Brai/ecto-doctor/blob/v0.0.1/lib/ecto_doctor/finding.ex#L1)

Describes one problem a check found.

The `:fix` field holds the code change to make, or the plan for a slow query.
The `:query` field holds the SQL a slow query finding is about.
The `:migration` field holds the migration steps that fix it and the phase each one runs in.

Concurrent index changes run on their own and new constraints are validated in a later migration.

# `level`

```elixir
@type level() :: :error | :warning | :info
```

# `phase`

```elixir
@type phase() :: :concurrent | :add | :validate
```

# `t`

```elixir
@type t() :: %EctoDoctor.Finding{
  check: atom(),
  columns: [String.t()],
  file: nil | String.t(),
  fix: nil | String.t(),
  level: level(),
  line: nil | pos_integer(),
  message: String.t(),
  migration: [{phase(), String.t()}],
  query: nil | String.t(),
  schema: nil | module(),
  table: nil | String.t()
}
```

# `key`

```elixir
@spec key(t()) :: String.t()
```

Returns the stable key the baseline file keeps for a finding.

It leaves out the message and line so a finding that moves still matches.

# `rank`

```elixir
@spec rank(level()) :: non_neg_integer()
```

Returns a level's rank where 0 is the most severe.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
