mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-30 12:47:42 +01:00
12c742f8dc
Upgrade builder to v0.3.11 Upgrade xorm to v1.3.1 and fixed some hidden bugs. Replace #19821 Replace #19834 Included #19850 Co-authored-by: zeripath <art27@cantab.net>
27 lines
704 B
Go
27 lines
704 B
Go
// Copyright 2021 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 (
|
|
"xorm.io/xorm"
|
|
"xorm.io/xorm/schemas"
|
|
)
|
|
|
|
func convertAvatarURLToText(x *xorm.Engine) error {
|
|
dbType := x.Dialect().URI().DBType
|
|
if dbType == schemas.SQLITE { // For SQLITE, varchar or char will always be represented as TEXT
|
|
return nil
|
|
}
|
|
|
|
// Some oauth2 providers may give very long avatar urls (i.e. Google)
|
|
return modifyColumn(x, "external_login_user", &schemas.Column{
|
|
Name: "avatar_url",
|
|
SQLType: schemas.SQLType{
|
|
Name: schemas.Text,
|
|
},
|
|
Nullable: true,
|
|
DefaultIsEmpty: true,
|
|
})
|
|
}
|