code.gitea.io/gitea@v1.21.7/models/migrations/v1_9/v83.go (about)

     1  // Copyright 2019 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package v1_9 //nolint
     5  
     6  import (
     7  	"code.gitea.io/gitea/modules/timeutil"
     8  
     9  	"xorm.io/xorm"
    10  )
    11  
    12  func AddUploaderIDForAttachment(x *xorm.Engine) error {
    13  	type Attachment struct {
    14  		ID            int64  `xorm:"pk autoincr"`
    15  		UUID          string `xorm:"uuid UNIQUE"`
    16  		IssueID       int64  `xorm:"INDEX"`
    17  		ReleaseID     int64  `xorm:"INDEX"`
    18  		UploaderID    int64  `xorm:"INDEX DEFAULT 0"`
    19  		CommentID     int64
    20  		Name          string
    21  		DownloadCount int64              `xorm:"DEFAULT 0"`
    22  		Size          int64              `xorm:"DEFAULT 0"`
    23  		CreatedUnix   timeutil.TimeStamp `xorm:"created"`
    24  	}
    25  
    26  	return x.Sync(new(Attachment))
    27  }