|
|
@ -59,7 +59,7 @@ func initMysqlDB() {
|
|
|
|
&GroupMember{},
|
|
|
|
&GroupMember{},
|
|
|
|
&GroupRequest{},
|
|
|
|
&GroupRequest{},
|
|
|
|
&User{},
|
|
|
|
&User{},
|
|
|
|
&Black{}, &ChatLog{}, &Register{})
|
|
|
|
&Black{}, &ChatLog{}, &Register{}, &Conversation{})
|
|
|
|
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")
|
|
|
|
|
|
|
|
|
|
|
@ -105,6 +105,10 @@ func initMysqlDB() {
|
|
|
|
log.NewInfo("CreateTable Black")
|
|
|
|
log.NewInfo("CreateTable Black")
|
|
|
|
db.CreateTable(&Register{})
|
|
|
|
db.CreateTable(&Register{})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if !db.HasTable(&Conversation{}) {
|
|
|
|
|
|
|
|
log.NewInfo("CreateTable Black")
|
|
|
|
|
|
|
|
db.CreateTable(&Conversation{})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|