592 B · text History cd6ad80
defmodule GitGud.Repo.Migrations.AddRunnerArchitecture do
  use Ecto.Migration

  @moduledoc """
  `runners.architecture` — what the runner's machine is, set by an
  operator. Every runner up to now was x86_64, and `runs-on:
  self-hosted` was written assuming so; the default keeps them, and
  those workflows, as they were.
  """

  def change do
    alter table(:runners) do
      add :architecture, :string, null: false, default: "x86_64"
    end

    create constraint(:runners, :runners_architecture,
             check: "architecture IN ('x86_64', 'aarch64')"
           )
  end
end