From bda9719ecb45ad6ba1d5aa11627022e774db845c Mon Sep 17 00:00:00 2001 From: sauls8t Date: Tue, 4 Feb 2020 14:36:40 +0000 Subject: [PATCH] Handle non-pinned spaces --- domain/document/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain/document/store.go b/domain/document/store.go index 6ded8c09..3e82c785 100644 --- a/domain/document/store.go +++ b/domain/document/store.go @@ -367,7 +367,7 @@ func (s Store) PinSequence(ctx domain.RequestContext, spaceID string) (max int, max = 0 err = s.Runtime.Db.Get(&max, s.Bind(` - SELECT MAX(c_seq) + SELECT COALESCE(MAX(c_seq), 0) FROM dmz_doc WHERE c_orgid=? AND c_spaceid=? AND c_seq != 99999`),