pull/351/head
wangchuxiao 2 years ago
parent eeb5ba4c7b
commit 7c79d10f5d

@ -90,7 +90,7 @@ func initMysqlDB() {
&GroupRequest{},
&User{},
&Black{}, &ChatLog{}, &Register{}, &Conversation{}, &AppVersion{}, &Department{}, &BlackList{}, &IpLimit{}, &UserIpLimit{}, &Invitation{}, &RegisterAddFriend{},
&ClientInitConfig{})
&ClientInitConfig{}, &UserIpRecord{})
db.Set("gorm:table_options", "CHARSET=utf8")
db.Set("gorm:table_options", "collation=utf8_unicode_ci")
@ -181,6 +181,11 @@ func initMysqlDB() {
db.Migrator().CreateTable(&ClientInitConfig{})
}
if !db.Migrator().HasTable(&UserIpRecord{}) {
fmt.Println("CreateTable Friend")
db.Migrator().CreateTable(&UserIpRecord{})
}
DB.MysqlDB.db = db
return
}

Loading…
Cancel
Save