From bc9903191e7c80ce61c1fe2cf9526caaf198ea99 Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 22 Dec 2021 13:14:50 +0100 Subject: [PATCH] fix migration script --- db/migrations/0188__set_hidden_branchId.sql | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/db/migrations/0188__set_hidden_branchId.sql b/db/migrations/0188__set_hidden_branchId.sql index abb2d18f5..8ef8116d7 100644 --- a/db/migrations/0188__set_hidden_branchId.sql +++ b/db/migrations/0188__set_hidden_branchId.sql @@ -1 +1,8 @@ -UPDATE branches SET branchId = 'hidden' where parentNoteId = 'root' AND noteId = 'hidden'; +UPDATE branches SET branchId = 'hidden' where branchId = ( + SELECT branchId FROM branches + WHERE parentNoteId = 'root' + AND noteId = 'hidden' + AND isDeleted = 0 + ORDER BY utcDateModified + LIMIT 1 +);