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>
26 lines
589 B
Go
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
|
|
}
|