Closed void-- closed 3 years ago
Hey @deluan ! Anything I can do to help get this merged? Or is there a different way you would like to see this implemented?
Sorry for the delay, I'm planning to update all dependencies and releasing a new version today, including this PR. Thanks for your contribution
Awesome, no problem! Sorry for pushing!
@deluan This PR would be really helpful for us! Could you take another look at this issue?
I started updating the project, but the integration tests are failing. Will have to fix that first. This PR is in my todo list for the next release
Sorry about the delay on this issue, but I'd like to understand how people want to use this. Schema migration scripts should be version controlled with application code, so they can be in sync (the schema reflects what is expected by the application).
I agree that the folder could be configurable, but it should always be a folder under the project's root (or under some subdir inside the root). With this PR, one could potentially have their migration scripts outside of the project's source repository, which could cause issues, as the project's code and the Contentful schema could become out-of-sync.
Is this really a desirable feature? What is the use case? Why it is so important to change the folder where migrations are stored? I see this the same as the location of, say, the package.json
: There's a convention where it is stored and people know where to look for it. Maybe I'm missing something here.....
No worries!
So, we actually forked the project and have been using this for a while -- the two main benefits for us are a) we get to pick where the migrations directory is (obviously), meaning we can group it together with other contentful related directories (e.g. apps/ui-extensions/schema). and b) we don't have to cd into the directory to run the command, we can just run it from wherever.
Neither of these benefits are things we couldn't live without, but it's definitely made the tool much more enjoyable to use.
I understand your concern about placing the migrations dir outside of version control, that would be a very bad idea, but maybe could be mitigated by adding this caveat to the documentation?
@deluan whatcha think? should I add a note in the documentation, or are you opposed to moving forward with this?
Yes, let's add a note in the documentation, and I'll merge this. Can you please add it?
Hello! Any updates on when this PR will be merged? My team could also really use this feature soon.
Hey Aaron! Sorry, I'll try to make that note in the documentation this afternoon!
No worries! Thank you for the quick response; I'll look forward to seeing it!
Okay @deluan pushed!
LGTM. Thanks!
These changes allow the user to have the migrations directory somewhere other than the project root, and allow for a directory name other than "migrations" by setting the fully qualified path to the desired migrations directory in the CONTENTFUL_MIGRATIONS_DIR environment variable.