mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 12:07:50 +01:00
e78786ef39
* Add is_writable checkbox to deploy keys interface * Add writable key option to deploy key form * Add support for writable ssh keys in the interface * Rename IsWritable to ReadOnly * Test: create read-only and read-write deploy keys via api * Add DeployKey access mode migration * Update gitea sdk via govendor * Fix deploykey migration * Add unittests for writable deploy keys * Move template text to locale * Remove implicit column update * Remove duplicate locales * Replace ReadOnly field with IsReadOnly method * Fix deploy_keys related integration test * Rename v54 migration with v55 * Fix migration hell
24 lines
494 B
Go
24 lines
494 B
Go
// Copyright 2018 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package migrations
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"code.gitea.io/gitea/models"
|
|
"github.com/go-xorm/xorm"
|
|
)
|
|
|
|
func addModeToDeploKeys(x *xorm.Engine) error {
|
|
type DeployKey struct {
|
|
Mode models.AccessMode `xorm:"NOT NULL DEFAULT 1"`
|
|
}
|
|
|
|
if err := x.Sync2(new(DeployKey)); err != nil {
|
|
return fmt.Errorf("Sync2: %v", err)
|
|
}
|
|
return nil
|
|
}
|