mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
refactor: clean up pull request comment related code and template dict (#39789)
1. drop comment.commit_id 2. refactor templates, remove `dict "." .` from templates
This commit is contained in:
1 parent
1c117a9352
commit
222136ee71
28 files changed
+321
-266
No files matched your search
@@ -437,6 +437,7 @@ func prepareMigrationTasks() []*migration {
|
||||
newMigration(358, "Track previous remember-me token hashes", v29.AddPreviousAuthTokenHash),
|
||||
newMigration(359, "Add stage and number columns to action_task_step", v29.AddStageAndNumberToActionTaskStep),
|
||||
newMigration(360, "Move branch protection settings to JSON", v29.MoveBranchProtectionConfigToJSON),
|
||||
newMigration(361, "Drop legacy commit_id column from comment", v29.DropCommentCommitID),
|
||||
}
|
||||
return preparedMigrations
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v29
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitea.dev/modelmigration/base"
|
||||
)
|
||||
|
||||
func DropCommentCommitID(ctx context.Context, x base.EngineMigration) error {
|
||||
exists, err := x.Dialect().IsColumnExist(x.DB(), ctx, "comment", "commit_id")
|
||||
if err != nil || !exists {
|
||||
return err
|
||||
}
|
||||
|
||||
return base.EngineTransaction(x, func(sess base.Session) error {
|
||||
return base.DropTableColumns(sess, "comment", "commit_id")
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user