defmodule GitGud.Repo.Migrations.AddModerationFields do
use Ecto.Migration
@tables ~w(issues issue_comments pull_requests pr_comments)a
def change do
for table_name <- @tables do
alter table(table_name) do
add :moderated_at, :utc_datetime
add :moderated_by_id, references(:users, on_delete: :nilify_all)
add :moderation_note, :text
add :original_body, :text
end
create index(table_name, [:moderated_at])
end
end
end
485 B · text
5af55d9