demo modify

This commit is contained in:
Gordon
2022-02-11 16:25:28 +08:00
parent 609ec24c6a
commit a885d7f003
11 changed files with 183 additions and 313 deletions
+9 -1
View File
@@ -58,7 +58,7 @@ func initMysqlDB() {
&GroupMember{},
&GroupRequest{},
&User{},
&Black{}, &ChatLog{})
&Black{}, &ChatLog{}, &Register{})
db.Set("gorm:table_options", "CHARSET=utf8")
db.Set("gorm:table_options", "collation=utf8_unicode_ci")
@@ -96,6 +96,14 @@ func initMysqlDB() {
log.NewInfo("CreateTable Black")
db.CreateTable(&Black{})
}
if !db.HasTable(&ChatLog{}) {
log.NewInfo("CreateTable Black")
db.CreateTable(&ChatLog{})
}
if !db.HasTable(&Register{}) {
log.NewInfo("CreateTable Black")
db.CreateTable(&Register{})
}
return