Follow wxiaoguang's suggestion

This commit is contained in:
Lunny Xiao
2024-04-20 20:19:59 +08:00
parent 20fbed7a67
commit 99fef44280
2 changed files with 10 additions and 13 deletions
+10 -6
View File
@@ -7,12 +7,16 @@ import (
"xorm.io/xorm"
)
type oAuth2Application struct {
ID int64
ConfidentialClient bool `xorm:"NOT NULL DEFAULT TRUE"`
}
func (oAuth2Application) TableName() string {
return "oauth2_application"
}
// AddConfidentialColumnToOAuth2ApplicationTable: add ConfidentialClient column, setting existing rows to true
func AddConfidentialClientColumnToOAuth2ApplicationTable(x *xorm.Engine) error {
type OAuth2Application struct {
ID int64
ConfidentialClient bool `xorm:"NOT NULL DEFAULT TRUE"`
}
return x.Table("oauth2_application").Sync(new(OAuth2Application))
return x.Sync(new(oAuth2Application))
}