Skip to content

Commit

Permalink
Fix migration-files to sort by numerically instead of string-wise.
Browse files Browse the repository at this point in the history
  • Loading branch information
fukamachi committed Jun 18, 2024
1 parent e957ca0 commit 80991a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/migration/versions.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@
(error ()
(warn "Invalid version format in a migration file: ~A~%Version must be an integer. Ignored." file))))))

(defun migration-files (base-directory &key (sort-by #'string<))
(defun migration-files (base-directory &key (sort-by #'<))
(sort (uiop:directory-files (merge-pathnames #P"migrations/" base-directory)
"*.up.sql")
sort-by
:key #'pathname-name))
:key #'migration-file-version))

(defun %migration-status (directory)
(let ((db-versions
Expand Down

0 comments on commit 80991a6

Please sign in to comment.