Skip to content

Commit 0c0f7c8

Browse files
committed
add migrations
1 parent 70043c8 commit 0c0f7c8

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

models/migrations/migrations.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ var migrations = []Migration{
250250
NewMigration("delete orphaned attachments", deleteOrphanedAttachments),
251251
// v97 -> v98
252252
NewMigration("add repo_admin_change_team_access to user", addRepoAdminChangeTeamAccessColumnForUser),
253+
// v98 -> v99
254+
NewMigration("add original author name and id on migrated release", addOriginalAuthorOnMigratedReleases),
253255
}
254256

255257
// Migrate database to current version

models/migrations/v98.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2019 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package migrations
6+
7+
import "github.com/go-xorm/xorm"
8+
9+
func addOriginalAuthorOnMigratedReleases(x *xorm.Engine) error {
10+
type Release struct {
11+
ID int64
12+
OriginalAuthor string
13+
OriginalAuthorID int64 `xorm:"index"`
14+
}
15+
16+
return x.Sync2(new(Release))
17+
}

0 commit comments

Comments
 (0)