New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allows to filter seeds and migrations by extensions #2168
Conversation
… will be executed
@doomsower Thanks for the PR, contributions are extremely welcome :) I agree, would be better to have SUPPORTED_EXTENSIONS as default value. Otherwise PR looks clean, but it is missing related PR for the documentation and tests. |
Also added unit tests for modified code
@elhigu , I changed default extensions to former SUPPORTED_EXTENSIONS. I also added unit tests for Actually, I think it is better not to introduce this extra If everything is ok, I'll proceed with docs PR |
Beautiful, I haven't seen such clean code here for a while 👍 And I agree about the design issue, that it is weird to support multiple language migrations at the same time, but I don't see any strong reason to start limiting it now. Please proceed and if you see places where things could be made better and more safe for the user it is not out of the question to break backwards compatibility. We have been breaking it quite a lot lately while trying to make lib to work more sane manner, like throwing errors when user does something that is not defined or potentially dangerous behaviour. |
Added config option to filter seeds and migrations by extension
Thank you! |
Thanks! Everything seems to be in order. CI have been broken a while so I haven't been able to get some PRs in which were failing (and I've been very busy lately so I haven't got time to do much of maintenance)... so I cannot say anything about schedule yet. Next version will be 0.14.0 since there are again some breaking changes. |
This PR addresses issue #1922
I added
loadExtensions
parameter where you can specify allowed extensions of seeds/migrations to be executed. Default value is['js', 'ts']
as was suggested in this issue, but now I think maybe it should be set toSUPPORTED_EXTENSIONS
so the change is non-breaking?Couldn't find any tests that deal with ts/coffee/etc. migrations, so I don't know where to start from. I.e. how to to check that ts migrations is executed/not executed based on loadExtensions parameter? But this is small change, I think it's ok as is.
If this PR is acceptable, I will submit PR to docs too.