diff options
author | Thanos Apollo <[email protected]> | 2024-08-06 20:41:08 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-08-06 20:41:08 +0300 |
commit | e1eec6efc7cb1b15a800dd0ad25e0f7df3a6eddc (patch) | |
tree | 846387c258fcf061a031ac80c4f244efb15bbfaf /gnosis.el | |
parent | 176404ccadce3dcce1e8f8c5b08449f558275865 (diff) |
db: Add v2 function.
* Storing v2 update function for users that have not updated to v2.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -2180,6 +2180,19 @@ Return note ids for notes that match QUERY." `(like main ,(format "%%%s%%" word))) words)))) (gnosis-select 'id 'notes clause t))) +(defun gnosis-db-update-v2 () + "Update to first gnosis-db version." + (emacsql-with-transaction gnosis-db + (emacsql gnosis-db [:alter-table decks :add failure-factor]) + (emacsql gnosis-db [:alter-table decks :add ef-increase]) + (emacsql gnosis-db [:alter-table decks :add ef-decrease]) + (emacsql gnosis-db [:alter-table decks :add ef-threshold]) + (emacsql gnosis-db [:alter-table decks :add initial-interval]) + (emacsql gnosis-db (format "PRAGMA user_version = 2")) + (gnosis--create-table 'activity-log gnosis-db-schema-activity-log) + ;; Update to most recent gnosis db version. + (gnosis-db-update-v3))) + (defun gnosis-db-update-v3 () "Upgrade database to version 3." (emacsql-with-transaction gnosis-db |