Files
gitocean/models/forgejo_migrations/v16b_add_comment_line_count.go
T
steven.guiheuxandMathieu Fenniak 6a27eb051d feat(api,ui): add multiline comment on pullrequest (#12582)
Closes https://codeberg.org/forgejo/forgejo/issues/6093

This PR adds support for **multi-line review comments** on pull requests, allowing reviewers to select a range of lines in diffs instead of only a single line — similar to GitHub's implementation.

### Tests for Go changes

- I added test coverage for Go changes...
  - [X] in their respective `*_test.go` for unit tests.
  - [X] `make pr-go` before pushing

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12582
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
2026-06-03 16:06:29 +02:00

26 lines
589 B
Go

// Copyright 2026 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: GPL-3.0-or-later
package forgejo_migrations
import "code.forgejo.org/xorm/xorm"
func init() {
registerMigration(&Migration{
Description: "add extra_lines_count to comment for multi-line review comments",
Upgrade: addCommentExtraLinesCount,
})
}
func addCommentExtraLinesCount(x *xorm.Engine) error {
type Comment struct {
ExtraLinesCount int64 `xorm:"NOT NULL DEFAULT 0"`
}
_, err := x.SyncWithOptions(
xorm.SyncOptions{IgnoreDropIndices: true},
new(Comment),
)
return err
}