From 3b11202e3d8d40e3593e5091e1dae1c36274cb28 Mon Sep 17 00:00:00 2001 From: Chen-I Lim <46905241+chenilim@users.noreply.github.com> Date: Sat, 24 Jul 2021 08:08:25 -0700 Subject: [PATCH] InsertBlock per workspace logic (#777) --- server/services/store/sqlstore/blocks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/services/store/sqlstore/blocks.go b/server/services/store/sqlstore/blocks.go index e83dbb1f5..e7b35808b 100644 --- a/server/services/store/sqlstore/blocks.go +++ b/server/services/store/sqlstore/blocks.go @@ -392,7 +392,7 @@ func (s *SQLStore) InsertBlock(c store.Container, block *model.Block, userID str // block with ID exists, so this is an update operation query := s.getQueryBuilder().Update(s.tablePrefix+"blocks"). Where(sq.Eq{"id": block.ID}). - Set("workspace_id", c.WorkspaceID). + Where(sq.Eq{"COALESCE(workspace_id, '0')": c.WorkspaceID}). Set("parent_id", block.ParentID). Set("root_id", block.RootID). Set("modified_by", block.ModifiedBy).