kevlened / fireway

A schema migration tool for firestore
MIT License
279 stars 41 forks source link

Allow for extra files #10

Closed Nicholaiii closed 3 years ago

Nicholaiii commented 3 years ago

It would be really great if fireway didn't throw when encountering files that didn't meet the migration filename spec. This would allow for configuration files and helpers relevant to migrations to co-exist in the migrations folder. Maybe just return null like when the filename doesn't comply with semver. https://github.com/kevlened/fireway/blob/77d1aa65fe9953acbe7e380a853fd0f2c2324d17/src/index.js#L93

kevlened commented 3 years ago

Skipping files that don't meet the filename spec is a silent failure. When you have hundreds of migration files, it can become tedious to figure out if your migration ran just to discover a typo. I ran into this, which is why it's the default.

Does an option to skip filename validation solve your problem?

kevlened commented 3 years ago

I suppose it's pretty uncommon to mess up v[semver]. You're right that skipping anything that doesn't match just that prefix would solve most of the issues. Works for me.

Nicholaiii commented 3 years ago

I do understand the case for typos, that would definitely be a chore. Skipping non-v[semver] is a good option!

kevlened commented 3 years ago

Added in 0.3.2