|
|
@ -52,7 +52,6 @@ func initMysqlDB() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
log.NewInfo("open db ok ", dsn)
|
|
|
|
log.NewInfo("open db ok ", dsn)
|
|
|
|
db.Set("gorm:table_options", "CHARSET=utf8")
|
|
|
|
|
|
|
|
db.AutoMigrate(&Friend{},
|
|
|
|
db.AutoMigrate(&Friend{},
|
|
|
|
&FriendRequest{},
|
|
|
|
&FriendRequest{},
|
|
|
|
&Group{},
|
|
|
|
&Group{},
|
|
|
@ -60,6 +59,8 @@ func initMysqlDB() {
|
|
|
|
&GroupRequest{},
|
|
|
|
&GroupRequest{},
|
|
|
|
&User{},
|
|
|
|
&User{},
|
|
|
|
&Black{})
|
|
|
|
&Black{})
|
|
|
|
|
|
|
|
db.Set("gorm:table_options", "CHARSET=utf8")
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//if !db.HasTable(&Friend{}) {
|
|
|
|
//if !db.HasTable(&Friend{}) {
|
|
|
|
// log.NewInfo("CreateTable Friend")
|
|
|
|
// log.NewInfo("CreateTable Friend")
|
|
|
|