From 11f73b32a26fcfcfc7279b30280c102b27eb65fc Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 25 Dec 2023 02:52:21 +0200 Subject: Add extras db schema Table to hold data for: - Extra notes e.g Explanation for the answer - Images, path for image as a string --- gnosis.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnosis.el b/gnosis.el index 3af5089..aa7087f 100644 --- a/gnosis.el +++ b/gnosis.el @@ -277,12 +277,18 @@ Returns a list of the form (ef-increase ef-decrease ef)." (:foreign-key [id] :references notes [id] :on-delete :cascade))) +(defvar gnosis-db-schema-extras '([(id integer :primary-key :not-null) + (extra-notes string) + (images string)] + (:foreign-key [id] :references notes [id] + :on-delete :cascade))) + (defun gnosis-init () "Create notes content table." (interactive) ;;(make-directory (concat user-emacs-directory "gnosis")) - (dolist (table '(notes decks review review-log)) + (dolist (table '(notes decks review review-log extras)) (condition-case nil (gnosis--drop-table table) (error (message "No %s table to drop." table)))) @@ -296,6 +302,8 @@ Returns a list of the form (ef-increase ef-decrease ef)." (gnosis--create-table 'review gnosis-db-schema-review) ;; Create review-log table (gnosis--create-table 'review-log gnosis-db-schema-review-log) + ;; Create extras table + (gnosis--create-table 'extras gnosis-db-schema-extras) (gnosis-add-deck "Anatomy")) ;; Gnosis mode ;; -- cgit v1.2.3