From 2dc167cbb96e800b36a2d5c3405051915aeb7ff7 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 22 Dec 2024 11:39:06 +0100 Subject: [PATCH] fix: xorm:version default is inconsistent The following message is displayed when upgrading to Forgejo: [W] Table system_setting Column version db default is , struct default is 1 The same message also shows when upgrading from Gitea 1.21 to Gitea 1.22. It is fine for the version field to default to zero or NULL instead of one. --- models/system/setting.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/system/setting.go b/models/system/setting.go index 4472b4c228..cda60d1758 100644 --- a/models/system/setting.go +++ b/models/system/setting.go @@ -18,10 +18,10 @@ import ( ) type Setting struct { - ID int64 `xorm:"pk autoincr"` - SettingKey string `xorm:"varchar(255) unique"` // key should be lowercase - SettingValue string `xorm:"text"` - Version int `xorm:"version"` + ID int64 `xorm:"pk autoincr"` + SettingKey string `xorm:"varchar(255) unique"` // key should be lowercase + SettingValue string `xorm:"text"` + Version int Created timeutil.TimeStamp `xorm:"created"` Updated timeutil.TimeStamp `xorm:"updated"` }