Skip to content
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

Detect migrations automatically in TestCase #347

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ralphjsmit
Copy link

@ralphjsmit ralphjsmit commented Jan 3, 2025

Hello! Thank you for the nice package, I've used it a lot on (I think) all my packages!

Currently, in the TestCase file, people have to manually provide their migration paths. I've always found this a bit surprising/not-DX friendly, as it is very easy to just get and run all migrations instead of manually needing to provide the full path(s). Therefore, this PR replaces it with a simple snippet to just run all migrations in the database/migrations path.

The snippet is using the File::allFiles() method. This is fine, the only thing is that people would need to import the file after uncommenting for the most clean result. Alternatives like the scandir() function are also not great, as scandir() is returning results like . or .. and then the snippet to un-comment would start to contain if-conditions, even less nice.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant