1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 22:59:43 +02:00

implemented move content to another document

This commit is contained in:
Harvey Kandola 2017-01-22 15:22:14 -08:00
parent 07ee2248d4
commit b5a595e305
9 changed files with 105 additions and 19 deletions

View file

@ -496,3 +496,17 @@ func (p *Persister) DeletePageRevisions(pageID string) (rows int64, err error) {
return
}
// GetNextPageSequence returns the next sequence numbner to use for a page in given document.
func (p *Persister) GetNextPageSequence(documentID string) (maxSeq float64, err error) {
row := Db.QueryRow("SELECT max(sequence) FROM page WHERE orgid=? AND documentid=? AND pagetype='section'", p.Context.OrgID, documentID)
err = row.Scan(&maxSeq)
if err != nil {
maxSeq = 2048
}
maxSeq = maxSeq * 2
return
}