diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2016-11-13 00:54:04 -0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2016-11-13 10:54:04 +0800 |
commit | 739f07c98e1254f776a7cb943a3430de32b17d1d (patch) | |
tree | 5ba37863a5b2f3188413dc9267d57c63cdb744ff /models/migrations | |
parent | bd76e156bb08424841ff992aaffcc5aef913b703 (diff) | |
download | gitea-739f07c98e1254f776a7cb943a3430de32b17d1d.tar.gz gitea-739f07c98e1254f776a7cb943a3430de32b17d1d.zip |
Remember diff view style (#163)
Diffstat (limited to 'models/migrations')
-rw-r--r-- | models/migrations/migrations.go | 4 | ||||
-rw-r--r-- | models/migrations/v14.go | 12 |
2 files changed, 15 insertions, 1 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index e69cf993b7..957af42661 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -72,6 +72,8 @@ var migrations = []Migration{ // v13 -> v14:v0.9.87 NewMigration("set comment updated with created", setCommentUpdatedWithCreated), + + NewMigration("create user column diff view style", createUserColumnDiffViewStyle), } // Migrate database to current version @@ -96,7 +98,7 @@ func Migrate(x *xorm.Engine) error { v := currentVersion.Version if _MIN_DB_VER > v { - log.Fatal(4, `Gogs no longer supports auto-migration from your previously installed version. + log.Fatal(4, `Gogs no longer supports auto-migration from your previously installed version. Please try to upgrade to a lower version (>= v0.6.0) first, then upgrade to current version.`) return nil } diff --git a/models/migrations/v14.go b/models/migrations/v14.go index 79c31133f4..0cdcf1005f 100644 --- a/models/migrations/v14.go +++ b/models/migrations/v14.go @@ -22,3 +22,15 @@ func setCommentUpdatedWithCreated(x *xorm.Engine) (err error) { } return nil } + +type UserV14 struct { + DiffViewStyle string `xorm:"NOT NULL DEFAULT ''"` +} + +func (*UserV14) TableName() string { + return "user" +} + +func createUserColumnDiffViewStyle(x *xorm.Engine) error { + return x.Sync2(new(UserV14)) +} |