From a8ec166c723d0e341835701ac3e550f206faacfb Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Thu, 16 Dec 2021 13:50:55 -0500 Subject: fix(panettone): Fix export of issue status to SQL Postmodern changed[0] how users customize the way lisp values get exported to SQL - now, in addition to defining methods of `cl-postgres:to-sql-string`, we have to pass `:col-export` and `:col-import` args to the field itself in the dao class. I'm not *entirely* sure why both are necessary, but without both this doesn't work. [0]: https://github.com/marijnh/Postmodern/blob/v1.33.1/CHANGELOG.md#changelog-v-1331 Change-Id: Iae8fb63c34fb6c79b9dfa350129032aab5cd2233 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4383 Tested-by: BuildkiteCI Reviewed-by: tazjin Reviewed-by: sterni Autosubmit: grfn --- web/panettone/src/model.lisp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'web/panettone') diff --git a/web/panettone/src/model.lisp b/web/panettone/src/model.lisp index 77a7cd6da9..a3b75380c8 100644 --- a/web/panettone/src/model.lisp +++ b/web/panettone/src/model.lisp @@ -109,6 +109,9 @@ database connection." (declare (ignore initargs)) (created-at->timestamp obj)) +(defun keyword->str (kw) (string-downcase (symbol-name kw))) +(defun str->keyword (st) (alexandria:make-keyword (string-upcase st))) + (defclass issue (has-created-at) ((id :col-type serial :initarg :id :accessor id) (subject :col-type string :initarg :subject :accessor subject) @@ -121,7 +124,9 @@ database connection." :initarg :status :accessor status :initform :open - :col-default "open")) + :col-default "open" + :col-export keyword->str + :col-import str->keyword)) (:metaclass dao-class) (:keys id) (:table-name issues) -- cgit 1.4.1