aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-03-15 17:33:10 +0800
committerGitHub <noreply@github.com>2023-03-15 10:33:10 +0100
commit27494ed20d7b968b9db3fd9cddc12ab4b39ed852 (patch)
treed1688309bcdcf7b3e0da7bc89ef656da44148f6c /models/migrations
parent0d7cf7b76883b6bdba324e6f2f40ae69f6aa5977 (diff)
downloadgitea-27494ed20d7b968b9db3fd9cddc12ab4b39ed852.tar.gz
gitea-27494ed20d7b968b9db3fd9cddc12ab4b39ed852.zip
Fix missed migration in #22235 (#23482)
Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v1_20/v246.go16
2 files changed, 18 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 4cbcd95d20..d7a4d6e4b5 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -469,6 +469,8 @@ var migrations = []Migration{
NewMigration("Add NeedApproval to actions tables", v1_20.AddNeedApprovalToActionRun),
// v245 -> v246
NewMigration("Rename Webhook org_id to owner_id", v1_20.RenameWebhookOrgToOwner),
+ // v246 -> v247
+ NewMigration("Add missed column owner_id for project table", v1_20.AddNewColumnForProject),
}
// GetCurrentDBVersion returns the current db version
diff --git a/models/migrations/v1_20/v246.go b/models/migrations/v1_20/v246.go
new file mode 100644
index 0000000000..e6340ef079
--- /dev/null
+++ b/models/migrations/v1_20/v246.go
@@ -0,0 +1,16 @@
+// Copyright 2023 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package v1_20 //nolint
+
+import (
+ "xorm.io/xorm"
+)
+
+func AddNewColumnForProject(x *xorm.Engine) error {
+ type Project struct {
+ OwnerID int64 `xorm:"INDEX"`
+ }
+
+ return x.Sync(new(Project))
+}