summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2019-04-14 18:43:56 +0200
committertechknowlogick <matti@mdranta.net>2019-04-14 12:43:56 -0400
commitd699de32f2f6fd2216c8d620c8f53011e511b56b (patch)
tree1588178184132c2ac6f84af763ba003c469dba4c /models/migrations
parent38889f09cbe039217f159838961b631f8f8d3b46 (diff)
downloadgitea-d699de32f2f6fd2216c8d620c8f53011e511b56b.tar.gz
gitea-d699de32f2f6fd2216c8d620c8f53011e511b56b.zip
add .gpg url (match github behaviour) (#6610)
* add .gpg url (match github behaviour) * wildcard * test to export maximum data * working POC * add comment for old imported keys * cleaning * Update routers/user/profile.go Co-Authored-By: sapk <sapk@users.noreply.github.com> * add migration script * add integration tests
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v84.go18
2 files changed, 20 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index baedcbb715..62c41fb906 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -221,6 +221,8 @@ var migrations = []Migration{
NewMigration("hot fix for wrong release sha1 on release table", fixReleaseSha1OnReleaseTable),
// v83 -> v84
NewMigration("add uploader id for table attachment", addUploaderIDForAttachment),
+ // v84 -> v85
+ NewMigration("add table to store original imported gpg keys", addGPGKeyImport),
}
// Migrate database to current version
diff --git a/models/migrations/v84.go b/models/migrations/v84.go
new file mode 100644
index 0000000000..4acb94b9ce
--- /dev/null
+++ b/models/migrations/v84.go
@@ -0,0 +1,18 @@
+// Copyright 2019 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 (
+ "github.com/go-xorm/xorm"
+)
+
+func addGPGKeyImport(x *xorm.Engine) error {
+ type GPGKeyImport struct {
+ KeyID string `xorm:"pk CHAR(16) NOT NULL"`
+ Content string `xorm:"TEXT NOT NULL"`
+ }
+
+ return x.Sync2(new(GPGKeyImport))
+}