about summary refs log tree commit diff
path: root/web/panettone
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-12-16T18·50-0500
committerclbot <clbot@tvl.fyi>2021-12-16T18·59+0000
commita8ec166c723d0e341835701ac3e550f206faacfb (patch)
treeaf3066d0f4b4a760f0a27ebb13291d824e40961b /web/panettone
parentfaca687dda83d5c7eaf0d6daaddd4b5db3aebbe0 (diff)
fix(panettone): Fix export of issue status to SQL r/3269
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 <mail@tazj.in>
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: grfn <grfn@gws.fyi>
Diffstat (limited to 'web/panettone')
-rw-r--r--web/panettone/src/model.lisp7
1 files changed, 6 insertions, 1 deletions
diff --git a/web/panettone/src/model.lisp b/web/panettone/src/model.lisp
index 77a7cd6da92f..a3b75380c825 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)