594 B · text History 6280797
defmodule GitGud.Repo.Migrations.AddCommentEditTracking do
use Ecto.Migration
# Comments become editable and soft-deletable.
#
# Deletion is soft on purpose: the history timeline interleaves a
# comment's edits with everything else that happened, and those
# events have to keep rendering after the comment is gone. A hard
# delete would leave the timeline pointing at nothing.
def change do
for table <- [:issue_comments, :pr_comments] do
alter table(table) do
add :edited_at, :utc_datetime
add :deleted_at, :utc_datetime
end
end
end
end