555 B · text History 10e07e4
defmodule Vigil.Repo.Migrations.AddReleaseStatus do
  use Ecto.Migration

  # Slice 5: `sentry-cli releases archive/restore` (status open | archived),
  # and the indexes the release pages and stats look issues up by (they
  # also make a release's delete, which nilifies these, cheap).
  def change do
    alter table(:releases) do
      add :status, :string, null: false, default: "open"
    end

    create index(:issues, [:first_release_id])
    create index(:issues, [:last_release_id])
    create index(:issues, [:resolved_in_release_id])
  end
end