mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 12:29:05 +02:00
Detect migrating batch size (#7353)
* Make migrating batch size as configurable * detect different table batch insert size and remove config item * remove unrelated changes
This commit is contained in:
1 parent
ef57fe4ae3
commit
337d6915ff
4 files changed
+73
-17
No files matched your search
@@ -368,3 +368,9 @@ func DumpDatabase(filePath string, dbType string) error {
|
||||
}
|
||||
return x.DumpTablesToFile(tbs, filePath)
|
||||
}
|
||||
|
||||
// MaxBatchInsertSize returns the table's max batch insert size
|
||||
func MaxBatchInsertSize(bean interface{}) int {
|
||||
t := x.TableInfo(bean)
|
||||
return 999 / len(t.ColumnsSeq())
|
||||
}
|
||||
Reference in new issue
Block a user