lecaillon / Evolve

Database migration tool for .NET and .NET Core projects. Inspired by Flyway.
https://evolve-db.netlify.com
MIT License
846 stars 112 forks source link

Skip Hidden and System migration files by default #274

Closed wite27 closed 2 years ago

wite27 commented 2 years ago

Hi! I faced an issue when using Evolve in Kubernetes with mounting migration scripts as volumes via ConfigMap. To make long story short, in that case Kubernetes creates hidden folder ..data with files from ConfigMap at mountPath, and creates symlinks to mounted files, i.e.

Sql_Scripts
├── R__migration.sql --> links to ..data/R__migration.sql
├── ..data (hidden)
│   └── R__migration.sql --> links to ..2020_03_03_16_40_36.675612011/R__migration.sql
├── ..2020_03_03_16_40_36.675612011 (hidden)
│   └── R__migration.sql

And because Evolve does not skip Hidden files, it crashes with Found multiple sql migration files with the same version: R__migration.sql.

Also, that behavior is similar with Flyway, which skips hidden files by default.

Tip: I could use GetFiles with EnumerationOptions overload, but it's not supported in netstandard2.0

wite27 commented 2 years ago

@lecaillon could you take a look, please?

lecaillon commented 2 years ago

Will release an Evolve 3.1.0-alpha7 next week.