summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-11-20 07:23:58 +0200
committerThanos Apollo <[email protected]>2024-11-20 07:23:58 +0200
commit6015224c612aff455095d056b38c3dffa594cc95 (patch)
tree08c91d8d594f0a5a6def21842292f1c0be54dd51
parent660ef0691d0d407d67e87b83bca9ec8a09342b67 (diff)
Update databse schema
* Remove file as foreign key.
-rw-r--r--org-gnosis.el7
1 files 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