Skip to content

Commit

Permalink
Fix style-warnings in mito.migration.table.
Browse files Browse the repository at this point in the history
  • Loading branch information
fukamachi committed Jun 18, 2024
1 parent 9c6706b commit f658a73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/migration/table.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
#:ensure-class)
(:import-from #:alexandria
#:ensure-list
#:compose)
#:compose
#:when-let)
(:export #:*auto-migration-mode*
#:*migration-keep-temp-tables*
#:migrate-table
Expand Down Expand Up @@ -112,6 +113,7 @@ If this variable is T they won't be deleted after migration.")
columns-to-add)
(list-diff from-columns to-columns
:key #'car)
(declare (ignore columns-to-delete))
(let ((new-columns-have-default
(loop for new-column in columns-to-add
if (getf (cdr new-column) :default)
Expand Down Expand Up @@ -181,7 +183,9 @@ If this variable is T they won't be deleted after migration.")
type))
:default
(if (getf (cdr column) :not-null)
(or (getf (cdr column) :default)
(or (when-let ((default (getf (cdr column) :default)))
(push (car column) drop-defaults)
default)
(progn
(warn "Adding a non-null column ~S but there's no :initform to set default"
(car column))
Expand Down

0 comments on commit f658a73

Please sign in to comment.