diff options
Diffstat (limited to 'models/migrations')
-rw-r--r-- | models/migrations/migrations.go | 4 | ||||
-rw-r--r-- | models/migrations/v77.go | 17 |
2 files changed, 20 insertions, 1 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 1fa94c42aa..4c6b6d64bc 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -18,7 +18,7 @@ import ( "github.com/Unknwon/com" "github.com/go-xorm/xorm" gouuid "github.com/satori/go.uuid" - "gopkg.in/ini.v1" + ini "gopkg.in/ini.v1" "code.gitea.io/gitea/modules/generate" "code.gitea.io/gitea/modules/log" @@ -206,6 +206,8 @@ var migrations = []Migration{ NewMigration("clear nonused data which not deleted when user was deleted", clearNonusedData), // v76 -> v77 NewMigration("add pull request rebase with merge commit", addPullRequestRebaseWithMerge), + // v77 -> v78 + NewMigration("add theme to users", addUserDefaultTheme), } // Migrate database to current version diff --git a/models/migrations/v77.go b/models/migrations/v77.go new file mode 100644 index 0000000000..12e7456642 --- /dev/null +++ b/models/migrations/v77.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 addUserDefaultTheme(x *xorm.Engine) error { + type User struct { + Theme string `xorm:"VARCHAR(30)"` + } + + return x.Sync2(new(User)) +} |