summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-08-06 20:39:19 +0300
committerThanos Apollo <[email protected]>2024-08-06 20:39:19 +0300
commit75e073baefb3b13337d91990762f1eeda66b89c2 (patch)
tree65f5edee3e589a0481a4561523492b022f47492b
parent2a41bcba72847481584f118a9b1a4b1862d3bb31 (diff)
New database: Add db-update-v3.
* Storing of deck specific values now will be done using global variables, now in addition with tags. * Remove deprecated sm2 like nomeclature and use gnosis new variables.
-rw-r--r--gnosis.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 3e0049a..b092be2 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -2180,6 +2180,22 @@ Return note ids for notes that match QUERY."
`(like main ,(format "%%%s%%" word)))
words))))
(gnosis-select 'id 'notes clause t)))
+(defun gnosis-db-update-v3 ()
+ "Upgrade database to version 3."
+ (emacsql-with-transaction gnosis-db
+ (emacsql gnosis-db [:alter-table decks :drop-column failure-factor])
+ (emacsql gnosis-db [:alter-table decks :drop-column ef-increase])
+ (emacsql gnosis-db [:alter-table decks :drop-column ef-threshold])
+ (emacsql gnosis-db [:alter-table decks :drop-column ef-decrease])
+ (emacsql gnosis-db [:alter-table decks :drop-column initial-interval])
+ ;; Review changes
+ (emacsql gnosis-db [:alter-table review :rename ef :to gnosis])
+ (emacsql gnosis-db [:alter-table review :rename ff :to amnesia])
+ (emacsql gnosis-db [:alter-table review :drop-column interval])
+ ;; Add activity log
+ (gnosis--create-table 'activity-log gnosis-db-schema-activity-log)
+ ;; Update version
+ (emacsql gnosis-db (format "PRAGMA user_version = %s" gnosis-db-version))))
(defun gnosis-db-init ()
"Create essential directories & database."