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

v140.go 906 B

12345678910111213141516171819202122232425262728293031323334
  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. "fmt"
  7. "code.gitea.io/gitea/modules/timeutil"
  8. "xorm.io/xorm"
  9. )
  10. func addDatasetTable(x *xorm.Engine) error {
  11. type Dataset struct {
  12. ID int64 `xorm:"pk autoincr"`
  13. Title string `xorm:"INDEX NOT NULL"`
  14. Status int32 `xorm:"INDEX"`
  15. Category string
  16. Description string `xorm:"TEXT"`
  17. DownloadTimes int64
  18. License string
  19. Task string
  20. ReleaseID int64 `xorm:"INDEX"`
  21. UserID int64 `xorm:"INDEX"`
  22. CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
  23. UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
  24. }
  25. if err := x.Sync2(new(Dataset)); err != nil {
  26. return fmt.Errorf("Sync2: %v", err)
  27. }
  28. return nil
  29. }