Skip to content

Commit

Permalink
Create Application/Migration directory if missing when generating new…
Browse files Browse the repository at this point in the history
… migration
  • Loading branch information
mpscholten committed Nov 18, 2020
1 parent 3147eca commit a32a9a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions IHP/SchemaMigration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,6 @@ createMigration description = do
revision <- round <$> POSIX.getPOSIXTime
let slug = NameSupport.toSlug description
let migrationFile = tshow revision <> (if isEmpty slug then "" else "-" <> slug) <> ".sql"
Directory.createDirectoryIfMissing False "Application/Migration"
Text.writeFile ("Application/Migration/" <> cs migrationFile) "-- Write your SQL migration code in here\n"
pure Migration { .. }

0 comments on commit a32a9a1

Please sign in to comment.