diff options
author | Thanos Apollo <[email protected]> | 2023-12-25 02:52:21 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-25 02:53:52 +0200 |
commit | 11f73b32a26fcfcfc7279b30280c102b27eb65fc (patch) | |
tree | 6c7149a79c75d012fa7932068554e86dbe92d36b /gnosis.el | |
parent | 4a77e5e770b35dc5b63d00e1a97eeecb660fa7e0 (diff) |
Add extras db schema
Table to hold data for:
- Extra notes e.g Explanation for the answer
- Images, path for image as a string
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 ;; |