Created
December 26, 2010 15:21
-
-
Save certainty/755470 to your computer and use it in GitHub Desktop.
nomads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use nomads nomads-sql-de-lite fmt fmt-color filepath) | |
(migration-directory "./migrations") | |
(database-credentials "test.db") | |
(define (get-version) | |
(let ((version (get-environment-variable "VERSION"))) | |
(if version | |
(or (string->number version) (string->symbol version)) | |
'latest))) | |
(define (pretty-print-migration checkpoint irreversible?) | |
(let ((direction (car checkpoint)) | |
(migration (cdr checkpoint))) | |
(fmt #t | |
(pad-char #\. | |
(cat "[" | |
(fmt-bold (migration-version migration)) | |
"] " | |
(filepath:drop-extension (migration-filename migration)) | |
" " | |
(space-to 72) | |
"[" | |
(fmt-bold (if irreversible? (fmt-red "IRREVERSIBLE") (fmt-green "OK"))) | |
"]"))) | |
(newline))) | |
(migrate version: (get-version) callback: pretty-print-migration) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment