mirror of https://github.com/h44z/wg-portal.git
fix migration issue for mysql/mariadb (#128)
This commit is contained in:
parent
54716f7f53
commit
bda8c9a3d1
|
|
@ -41,6 +41,11 @@ func init() {
|
||||||
migrations = append(migrations, Migration{
|
migrations = append(migrations, Migration{
|
||||||
version: "1.0.9",
|
version: "1.0.9",
|
||||||
migrateFn: func(db *gorm.DB) error {
|
migrateFn: func(db *gorm.DB) error {
|
||||||
|
if db.Dialector.Name() != (sqlite.Dialector{}).Name() {
|
||||||
|
logrus.Infof("upgraded database format to version 1.0.9")
|
||||||
|
return nil // only perform migration for sqlite
|
||||||
|
}
|
||||||
|
|
||||||
type sqlIndex struct {
|
type sqlIndex struct {
|
||||||
Name string `gorm:"column:name"`
|
Name string `gorm:"column:name"`
|
||||||
Table string `gorm:"column:tbl_name"`
|
Table string `gorm:"column:tbl_name"`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue