mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-06-02 21:29:23 +08:00
add mysql
This commit is contained in:
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…
x
Reference in New Issue
Block a user