You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

v106.go 678B

1234567891011121314151617181920212223242526
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package migrations
  5. import (
  6. "xorm.io/xorm"
  7. )
  8. // RepoWatchMode specifies what kind of watch the user has on a repository
  9. type RepoWatchMode int8
  10. // Watch is connection request for receiving repository notification.
  11. type Watch struct {
  12. ID int64 `xorm:"pk autoincr"`
  13. Mode RepoWatchMode `xorm:"SMALLINT NOT NULL DEFAULT 1"`
  14. }
  15. func addModeColumnToWatch(x *xorm.Engine) (err error) {
  16. if err = x.Sync2(new(Watch)); err != nil {
  17. return
  18. }
  19. _, err = x.Exec("UPDATE `watch` SET `mode` = 1")
  20. return err
  21. }