code.gitea.io/gitea@v1.21.7/models/migrations/v1_12/v132.go (about)

     1  // Copyright 2020 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package v1_12 //nolint
     5  
     6  import (
     7  	"fmt"
     8  
     9  	"xorm.io/xorm"
    10  )
    11  
    12  func AddBranchProtectionProtectedFilesColumn(x *xorm.Engine) error {
    13  	type ProtectedBranch struct {
    14  		ProtectedFilePatterns string `xorm:"TEXT"`
    15  	}
    16  
    17  	if err := x.Sync(new(ProtectedBranch)); err != nil {
    18  		return fmt.Errorf("Sync: %w", err)
    19  	}
    20  	return nil
    21  }