-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Base directory is hardcoded for init script #268
Comments
Ah yeah, that looks like an omission. Any chance you could do a PR for this? |
Unfortunately my company's OSS policies are...unsettled, and I can't at present make contributions. |
Ah, fair enough. I'll take a look. |
Hmm, it looks like the migratus/src/migratus/database.clj Line 123 in f0972c6
|
When that function is called, the directory provided does not account for this option. It resolves the Tracing the data flow: We dispatch migratus/src/migratus/core.clj Lines 191 to 194 in f0972c6
The database implementation of migratus/src/migratus/database.clj Lines 292 to 300 in f0972c6
Both of those functions look only at their respective properties, falling back to the defaults of migratus/src/migratus/utils.clj Lines 20 to 28 in f0972c6
The migratus/src/migratus/database.clj Lines 279 to 282 in f0972c6
Nothing along the way has accounted for |
Here is where the actual hardcoding happens: migratus/src/migratus/utils.clj Lines 80 to 89 in f0972c6
And the function we've used to find the script does indeed call that unary overload of migratus/src/migratus/database.clj Lines 123 to 128 in f0972c6
|
Ah ok, thanks for digging in. It's been a while since I've looked at it. I'll try get a fix out in the coming days. |
Also worth mentioning: This option isn't actually documented. One alternative is to just say it's an implementation detail and not make this change. I think my use case is a compelling one for promoting it to a full-fledged feature, though. |
Yeah, I think this would be worth doing and doesn't look like it should be too much work. |
Ah, I just discovered that this also happens with the |
Ah yeah, looks like it might be a bit more fiddly than it initially appeared. Perhaps for your use case it might be easier to just use |
I wound up settling on a workaround of just using a couple |
I'll keep the issue open. I think it'd be good to fix if I get time. Glad the workaround is working in the mean time. |
I'm writing an adapter around Migratus for an internal task runner. I'd like to write tests for it, and I'd like those tests to use a suite of migrations in my project's
test_resources
directory. I see there is a:parent-migration-dir
option which controls where Migratus looks for themigrations
directory, and this project's own tests use that option to run test migrations. Theinit
function, however, does not respect this setting; it always looks inresources
.The text was updated successfully, but these errors were encountered: