Skip to content

Commit 53b8f29

Browse files
authored
generate-migrations now accepts a statement separator (#188)
For multiple database connectors to do migrations with multiple statements, including dbi, thestatements must be separted by `--;;` on a new line. This change provides a way to provide a custom separator when generating migrations.
1 parent 5d315c8 commit 53b8f29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/migration/versions.lisp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
(1+ current-version)
178178
1))))
179179

180-
(defun generate-migrations (directory &key force)
180+
(defun generate-migrations (directory &key force (statement-separator ""))
181181
(let ((schema.sql (merge-pathnames #P"schema.sql" directory))
182182
(directory (merge-pathnames #P"migrations/" directory))
183183
(current-version (current-migration-version)))
@@ -222,7 +222,7 @@
222222
(with-quote-char
223223
(map nil
224224
(lambda (ex)
225-
(format out "~&~A;~%" (sxql:yield ex)))
225+
(format out "~&~A;~%~A" (sxql:yield ex) statement-separator))
226226
expressions))))
227227
(let ((sxql:*use-placeholder* nil))
228228
(with-open-file (out schema.sql

0 commit comments

Comments
 (0)