Force utf8 encoding on migration

Force table coding to utf8 to avoid index too long error
pull/563/head
wzxjohn 5 years ago committed by GitHub
parent 40414fe6ae
commit e5551c3bff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,7 +32,7 @@ func migration() {
// 自动迁移模式
if conf.DatabaseConfig.Type == "mysql" {
DB = DB.Set("gorm:table_options", "ENGINE=InnoDB")
DB = DB.Set("gorm:table_options", "ENGINE=InnoDB CHARSET=utf8")
}
DB.AutoMigrate(&User{}, &Setting{}, &Group{}, &Policy{}, &Folder{}, &File{}, &Share{},
&Task{}, &Download{}, &Tag{}, &Webdav{})

Loading…
Cancel
Save