fix: Add the configuration of whether to print SQL. The default value is false (#429)

This commit is contained in:
hanpeng 2022-01-19 16:58:45 +08:00 committed by GitHub
parent 9fd175eefd
commit a111fd672c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,7 @@ copyrequestbody = true
driverName = mysql
dataSourceName = root:123456@tcp(localhost:3306)/
dbName = casdoor
showSql = false
redisEndpoint =
defaultStorageProvider =
isCloudIntranet = false

View File

@ -110,6 +110,9 @@ func (a *Adapter) close() {
}
func (a *Adapter) createTable() {
showSql, _ := beego.AppConfig.Bool("showSql")
a.Engine.ShowSQL(showSql)
err := a.Engine.Sync2(new(Organization))
if err != nil {
panic(err)