mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-20 11:49:57 +08:00
add mysql
This commit is contained in:
parent
eeb5ba4c7b
commit
7c79d10f5d
@ -90,7 +90,7 @@ func initMysqlDB() {
|
|||||||
&GroupRequest{},
|
&GroupRequest{},
|
||||||
&User{},
|
&User{},
|
||||||
&Black{}, &ChatLog{}, &Register{}, &Conversation{}, &AppVersion{}, &Department{}, &BlackList{}, &IpLimit{}, &UserIpLimit{}, &Invitation{}, &RegisterAddFriend{},
|
&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", "CHARSET=utf8")
|
||||||
db.Set("gorm:table_options", "collation=utf8_unicode_ci")
|
db.Set("gorm:table_options", "collation=utf8_unicode_ci")
|
||||||
|
|
||||||
@ -181,6 +181,11 @@ func initMysqlDB() {
|
|||||||
db.Migrator().CreateTable(&ClientInitConfig{})
|
db.Migrator().CreateTable(&ClientInitConfig{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !db.Migrator().HasTable(&UserIpRecord{}) {
|
||||||
|
fmt.Println("CreateTable Friend")
|
||||||
|
db.Migrator().CreateTable(&UserIpRecord{})
|
||||||
|
}
|
||||||
|
|
||||||
DB.MysqlDB.db = db
|
DB.MysqlDB.db = db
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user