gitea源码

123456789101112131415161718192021222324
  1. // Copyright 2024 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_23
  4. import (
  5. "code.gitea.io/gitea/modules/timeutil"
  6. "xorm.io/xorm"
  7. )
  8. func AddRepositoryLicenses(x *xorm.Engine) error {
  9. type RepoLicense struct {
  10. ID int64 `xorm:"pk autoincr"`
  11. RepoID int64 `xorm:"UNIQUE(s) NOT NULL"`
  12. CommitID string
  13. License string `xorm:"VARCHAR(255) UNIQUE(s) NOT NULL"`
  14. CreatedUnix timeutil.TimeStamp `xorm:"INDEX CREATED"`
  15. UpdatedUnix timeutil.TimeStamp `xorm:"INDEX UPDATED"`
  16. }
  17. return x.Sync(new(RepoLicense))
  18. }