修改建表语句

This commit is contained in:
高山 2018-04-19 15:22:23 +08:00
parent 5544123e19
commit 0ab75b894f
1 changed files with 1 additions and 3 deletions

View File

@ -119,9 +119,7 @@ func createdb() error {
//panic(err.Error())
return err
}
sqlstring1 := fmt.Sprintf("drop database if exists `%s` ", dbName)
db.Exec(sqlstring1)
sqlstring = fmt.Sprintf(" CREATE DATABASE `%s` CHARSET utf8 COLLATE utf8_general_ci", dbName)
sqlstring = fmt.Sprintf(" CREATE DATABASE if not exists `%s` CHARSET utf8 COLLATE utf8_general_ci", dbName)
r, err := db.Exec(sqlstring)
if err != nil {
beego.Info(err)