根据history id 删除记录
(historyId int)
| 180 | |
| 181 | // 根据history id 删除记录 |
| 182 | func (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删除 |
| 193 | func (history *DocumentHistory) DeleteByLimit(docId, limit int) (err error) { |
no test coverage detected