summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorSimon <simon@hilchenba.ch>2019-05-05 20:09:02 +0200
committertechknowlogick <hello@techknowlogick.com>2019-05-05 14:09:02 -0400
commita2a006a5d5a542c5c31bdce4647d2401eab88475 (patch)
treea71588a2291a5a5d2f9419208990fa5207593b77 /models/migrations
parent55a8e12d85bd59314416bb026e84d258004a5071 (diff)
downloadgitea-a2a006a5d5a542c5c31bdce4647d2401eab88475.tar.gz
gitea-a2a006a5d5a542c5c31bdce4647d2401eab88475.zip
Add GET requests to webhook (#6771)
* Add GET requests to webhook * make fmt * Handle invalid http method on webhook * Uppercase http method in webhook * Rename v85.go to v86.go * make fmt
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v86.go17
2 files changed, 19 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 1d8cf65785..b86c20576f 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -225,6 +225,8 @@ var migrations = []Migration{
NewMigration("add table to store original imported gpg keys", addGPGKeyImport),
// v85 -> v86
NewMigration("hash application token", hashAppToken),
+ // v86 -> v87
+ NewMigration("add http method to webhook", addHTTPMethodToWebhook),
}
// Migrate database to current version
diff --git a/models/migrations/v86.go b/models/migrations/v86.go
new file mode 100644
index 0000000000..492a08c71e
--- /dev/null
+++ b/models/migrations/v86.go
@@ -0,0 +1,17 @@
+// 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 addHTTPMethodToWebhook(x *xorm.Engine) error {
+ type Webhook struct {
+ HTTPMethod string `xorm:"http_method DEFAULT 'POST'"`
+ }
+
+ return x.Sync2(new(Webhook))
+}