Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set MySQL rowtype to dynamic for new tables #10833

Merged
merged 3 commits into from
Mar 27, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Set mysql rowtype to dynamic for new tables
  • Loading branch information
lafriks committed Mar 26, 2020
commit d06133444b4359ab4afac04a0f180e98cf344161
5 changes: 4 additions & 1 deletion models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,13 @@ func getEngine() (*xorm.Engine, error) {
return nil, err
}

engine, err := xorm.NewEngine(setting.Database.Type, connStr)
engine, err := xorm.NewEngineWithParams(setting.Database.Type, connStr)
lafriks marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return nil, err
}
if setting.Database.Type == "mysql" {
engine.Dialect().SetParams(map[string]string{"rowFormat": "DYNAMIC"})
}
engine.SetSchema(setting.Database.Schema)
return engine, nil
}
Expand Down