branch: externals/org-gnosis
commit 6015224c612aff455095d056b38c3dffa594cc95
Author: Thanos Apollo <pub...@thanosapollo.org>
Commit: Thanos Apollo <pub...@thanosapollo.org>

    Update databse schema
    
    * Remove file as foreign key.
---
 org-gnosis.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index fdf1bf6f09..7c29997b7f 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -193,8 +193,7 @@ INITIAL-TAGS: Initial set of tags to inherit."
      ([(id :not-null :primary-key)
        (file :not-null)
        (title text)
-       tags]
-      (:foreign-key [file] :references files [file] :on-delete :cascade)))
+       tags]))
     (refs
      ([(node-id :not-null)
        (ref :not-null)
@@ -212,7 +211,7 @@ INITIAL-TAGS: Initial set of tags to inherit."
   "Initialize database DB with the correct schema and user version."
   (unless (length= (emacsql org-gnosis-db
                            [:select name :from sqlite-master :where (= type 
table)])
-                  7)
+                  3)
     (emacsql-with-transaction org-gnosis-db
       (pcase-dolist (`(,table ,schema) org-gnosis-db--table-schemata)
        (emacsql org-gnosis-db [:create-table $i1 $S2] table schema))
@@ -220,5 +219,7 @@ INITIAL-TAGS: Initial set of tags to inherit."
        (emacsql org-gnosis-db [:create-index $i1 :on $i2 $S3] index-name table 
columns))
       (emacsql org-gnosis-db [:pragma (= user-version 
org-gnosis-db-version)]))))
 
+(org-gnosis-db-init)
+
 (provide 'org-gnosis)
 ;;; org-gnosis.el ends here

Reply via email to