-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(data-migrate): provide option to use db in dist instead of src #8375
Conversation
This sounds like a step forward, I think. I'm wondering, if it would improve things, if we would be able to pass a path, like prisma does to the schema. But I'm unsure. (It probably only saves you from changing folders when using a global install of |
@razzeee would the path be to the dataMigrations directory? |
I think it should be the path to the dist? unless it would work with the dataMigration folder only. if I could pass that path, I would assume, I would be able to only copy that folder to a machine and be able to run stuff, which probably won't work? |
@razzeee the rw --cwd path/to/project data-migrate up
# or
RWJS_CWD=path/to/project rw data-migrate up Just in case I still don't understand, here's what
I could still think about a |
Yeah, I think |
Ok @razzeee I think this is gtg but let me run it by a few others first |
…8375) * separate out up, install handlers * remove needless async * add missing @ * fix import * use values not entries * fix data structure * add back early return * rename to camel case * feat: support `--dist-path` flag * follow up fixes * apply suggestions from review
…8375) * separate out up, install handlers * remove needless async * add missing @ * fix import * use values not entries * fix data structure * add back early return * rename to camel case * feat: support `--dist-path` flag * follow up fixes * apply suggestions from review
@razzeee I just released this PR in an RC: |
@jtoar I tried to validate this, but I seem to run into something unrelated. I can't access the deployed frontend anymore, after deploying with my (partly) reverted changes. Haven't really looked at db migrations due to that. Anyway, spend enough time on this for this week, I can probably have another go next week. |
No worries I appreciate you trying! |
…8375) * separate out up, install handlers * remove needless async * add missing @ * fix import * use values not entries * fix data structure * add back early return * rename to camel case * feat: support `--dist-path` flag * follow up fixes * apply suggestions from review
…8375) * separate out up, install handlers * remove needless async * add missing @ * fix import * use values not entries * fix data structure * add back early return * rename to camel case * feat: support `--dist-path` flag * follow up fixes * apply suggestions from review
Fixes #8059. This PR:
yarn rw data-migrate up
can run using thelib/db
indist
instead ofsrc
:Right now,
yarn rw data-migrate up
imports db fromapi/src/lib
. I think the logic is, we use the require hook anyway to run the migration scripts, so we may as well use it to import the db fromapi/src/lib
too. But we now realize that api/src may not always be available.@razzeee I want to confirm this solves your use case in case you're set up is different than I thought. Now
api/src/lib/db
no longer needs to be available, butapi/dist/lib/db
does.