code.gitea.io/gitea@v1.22.3/models/migrations/v1_22/v295.go (about)

     1  // Copyright 2024 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package v1_22 //nolint
     5  
     6  import "xorm.io/xorm"
     7  
     8  func AddCommitStatusSummary(x *xorm.Engine) error {
     9  	type CommitStatusSummary struct {
    10  		ID     int64  `xorm:"pk autoincr"`
    11  		RepoID int64  `xorm:"INDEX UNIQUE(repo_id_sha)"`
    12  		SHA    string `xorm:"VARCHAR(64) NOT NULL INDEX UNIQUE(repo_id_sha)"`
    13  		State  string `xorm:"VARCHAR(7) NOT NULL"`
    14  	}
    15  	// there is no migrations because if there is no data on this table, it will fall back to get data
    16  	// from commit status
    17  	return x.Sync2(new(CommitStatusSummary))
    18  }