Closed daa closed 2 years ago
Great idea.
I do wonder if directory
should actually be deprecated in favor of filename
. I like the idea of glob patterns for the migrations. That would make the schema and migrations configuration identical.
I just released Tusker 0.4.0 which includes these changes.
I also change the README so it uses migrations.filename
rather than migrations.directory
.
It doesn't hurt to have some backwards compatibility, but I'd prefer to remove the migrations.directory
configuration option in the future.
Thank you very much!
I overlooked that migration filenames are filtered by .sql
extension even if they are defined by glob pattern, will fix it later.
Oh right. I missed that when reviewing the PR as well. :see_no_evil:
Using a .sql
extension is a sensible choice, but that should not be enforced when using glob patterns. If you create a PR for that I'll merge that and prepare a 0.4.1 release.
Recently I had a need to support migration tool using slightly different migration structure not supported directly by Tusker:
migrations/<dbname>/<timestamp>_name/{up,down}.sql
(Hasura migrations). And Tusker happened to be so wonderful tool that I couldn't refuse to use it so I decided to implement a new feature.Here new optional
filename
parameter is supported in themigrations
section. This parameter defines a glob pattern for migration filenames and is mutually exclusive withdirectory
.