Support renaming placeholders or mapping placeholders to environment variables with a different name
See original GitHub issueFeature description
I’ve run into a situation where the previous names for some of the placeholders could be improved to reflect their more specific use case.
It would be nice to be able to rename placeholders. Not sure if this could be done by having a rename command that finds and replaces the placeholders in the migrations and regenerat the hash:es and I believe some way of updating the migration hashes in the database would need to be found.
An alternative approach would be to be able to map placeholders to environment variables with a different name. I see this as a feature that could make sense outside of the scope of this feature request, but it would provide a way to work around not being able to rename the placeholders.
Motivating example
If you ever want to change the name of a placeholder, you would have to first search replaces the placeholder in all previous migrations as well as add allowInvalidHash comments.
In case you just want to change the name of an environment variable you need to keep the old one and keep them in sync.
Breaking changes
If the hashing part of migrate were to be updated to exclude the placeholders from the hash. Then a simple search replace and rename would be possible, but this would probably be a breaking change.
Supporting development
I [tick all that apply]:
- am interested in building this feature myself
- am interested in collaborating on building this feature
- am willing to help testing this feature before it’s released
- am willing to write a test-driven test suite for this feature (before it exists)
- am a Graphile sponsor ❤️
- have an active support or consultancy contract with Graphile
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Let’s close this as I have a solution and using .js for config files is usually something I do and somehow missed that I could do it with graphile migrate as well…
(If we were to do it, I think your
"!ENV:OTHER_THING_HERE"
suggestion is a solid one.)