MCPcopy Index your code
hub / github.com/TruthHun/BookStack / DeleteByHistoryId

Method DeleteByHistoryId

models/document_history.go:182–190  ·  view source on GitHub ↗

根据history id 删除记录

(historyId int)

Source from the content-addressed store, hash-verified

180
181// 根据history id 删除记录
182func (history *DocumentHistory) DeleteByHistoryId(historyId int) (err error) {
183 history, err = history.Find(historyId)
184 if history.Version > 0 {
185 ver := NewVersionControl(history.DocumentId, history.Version)
186 ver.DeleteVersion()
187 }
188 _, err = orm.NewOrm().QueryTable(history.TableNameWithPrefix()).Filter("history_id", historyId).Delete()
189 return
190}
191
192// 根据文档id删除
193func (history *DocumentHistory) DeleteByLimit(docId, limit int) (err error) {

Callers 1

DeleteHistoryMethod · 0.80

Calls 5

FindMethod · 0.95
TableNameWithPrefixMethod · 0.95
NewVersionControlFunction · 0.85
DeleteVersionMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected