defmodule GitGud.Repo.Migrations.AddPrSourceRepo do
use Ecto.Migration
def change do
alter table(:pull_requests) do
# NULL = same-repo PR (current behavior). Otherwise the PR's
# source branch lives on this fork; mergeability + merge use a
# `refs/pull/<N>/head` we fetch into the target.
add :source_repository_id, references(:repositories, on_delete: :nilify_all)
end
create index(:pull_requests, [:source_repository_id])
end
end
476 B · text
5af55d9