branch: elpa/gnosis
commit d4e67d2f8820977998975be8e515afa8f76f45e8
Author: Thanos Apollo <pub...@thanosapollo.org>
Commit: Thanos Apollo <pub...@thanosapollo.org>

    db-update-v4: Only create new tables if they do not exist.
    
    + Minor adjustment for testing purposes.
---
 gnosis.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnosis.el b/gnosis.el
index 43abcdf14e..60c8f6e18d 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2317,9 +2317,9 @@ Return note ids for notes that match QUERY."
   "Update to databse version v4."
   (let ((tags (gnosis-get-tags--unique)))
     (pcase-dolist (`(,table ,schema) (seq-filter (lambda (schema)
-                                                  (member (car schema) '(tags 
links)))
+                                                  (member (car schema) '(links 
tags)))
                                                 gnosis-db--schemata))
-      (emacsql gnosis-db [:create-table $i1 $S2] table schema))
+      (emacsql gnosis-db [:create-table :if-not-exists $i1 $S2] table schema))
     (cl-loop for tag in tags
             do (gnosis--insert-into 'tags `[,tag]))
     (emacsql gnosis-db [:alter-table notes :rename-column main :to keimenon])

Reply via email to