From 6015224c612aff455095d056b38c3dffa594cc95 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 20 Nov 2024 07:23:58 +0200 Subject: 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 fdf1bf6..7c29997 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 -- cgit v1.2.3