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.

v202.go 627B

1234567891011121314151617181920212223
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_16 //nolint
  4. import (
  5. "fmt"
  6. "xorm.io/xorm"
  7. )
  8. func CreateUserSettingsTable(x *xorm.Engine) error {
  9. type UserSetting struct {
  10. ID int64 `xorm:"pk autoincr"`
  11. UserID int64 `xorm:"index unique(key_userid)"` // to load all of someone's settings
  12. SettingKey string `xorm:"varchar(255) index unique(key_userid)"` // ensure key is always lowercase
  13. SettingValue string `xorm:"text"`
  14. }
  15. if err := x.Sync(new(UserSetting)); err != nil {
  16. return fmt.Errorf("sync2: %w", err)
  17. }
  18. return nil
  19. }