miniblog

Miniblog: A command-line static blog system in Common Lisp
Log | Files | Refs | README | LICENSE

commit 1221b0df0749f37d4ad9a9f44ea633e7a8b54030
parent 378c05b0d7b7dd1c9c9bf3ea296db9bb3019070a
Author: Decay <decay@todayiwilllaunchmyinfantsonintoorbit.com>
Date:   Sat,  2 Nov 2024 16:05:18 -0700

Automatically update DB schemas

As promised!

Diffstat:
Msrc/db.lisp | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/db.lisp b/src/db.lisp @@ -38,10 +38,13 @@ (:unique-keys (parent name))) (defun init-tables () - "Initialize the DB schema. Currently just does the mito - yakshaving to create the BLOG-ENTRIES table." + "Initialize the DB schema. Verifies that tables exist and does necessary migrations." (ensure-table-exists 'blog-entries) - (ensure-table-exists 'blog-pages)) + (ensure-table-exists 'blog-pages) + (when (migration-expressions 'blog-entries) + (migrate-table 'blog-entries)) + (when (migration-expressions 'blog-pages) + (migrate-table 'blog-pages))) (defun init (&rest params) "Initialize the DB DAO. Consumes parameters identical to