erikbra / grate

grate - the SQL scripts migration runner
MIT License
209 stars 40 forks source link

Create database fails when an empty createDatabase folder is present #532

Open theiam79 opened 5 months ago

theiam79 commented 5 months ago

Describe the bug If an empty createDatabase folder exists, grate does not fall back to the default creation script, so no database is created.

To Reproduce Create all default folders for grate, leaving createDatabase empty. Attempt to run a migration targeting a database that doesn't exist.

Expected behavior The default creation script to be used (or clearer docs about which folders can be safely left empty)

Desktop (please complete the following information):

Additional context This isn't really a huge issue, as I mostly stumbled into it because I created the entire folder schema while testing the tool. I think making it work like the other folders (where they are ignored if empty) or clearly documenting that it is an exception would be fine.