gitea源码

v299.go 486B

1234567891011121314151617181920212223
  1. // Copyright 2024 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_23
  4. import "xorm.io/xorm"
  5. func AddContentVersionToIssueAndComment(x *xorm.Engine) error {
  6. type Issue struct {
  7. ContentVersion int `xorm:"NOT NULL DEFAULT 0"`
  8. }
  9. type Comment struct {
  10. ContentVersion int `xorm:"NOT NULL DEFAULT 0"`
  11. }
  12. _, err := x.SyncWithOptions(xorm.SyncOptions{
  13. IgnoreConstrains: true,
  14. IgnoreIndices: true,
  15. }, new(Comment), new(Issue))
  16. return err
  17. }