question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support renaming placeholders or mapping placeholders to environment variables with a different name

See original GitHub issue

Feature 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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
zimmecommented, Feb 18, 2022

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…

0reactions
benjiecommented, Feb 4, 2022

(If we were to do it, I think your "!ENV:OTHER_THING_HERE" suggestion is a solid one.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring: define @RequestMapping value in a properties file
Patterns in @RequestMapping annotations support ${…​ } placeholders against local properties and/or system properties and environment variables.
Read more >
Configuration File | Crowdin Developer Portal
Placeholders. Crowdin CLI allows to use the following placeholders to put appropriate variables into the resulting file name: Name, Description ...
Read more >
24. Externalized Configuration - Spring
Spring Boot allows you to externalize your configuration so you can work with the same application code in different environments. You can use...
Read more >
Placeholders - Flyway by Redgate • Database Migrations ...
Placeholders can be configured through a number of different ways. Via environment variables. FLYWAY_PLACEHOLDERS_MYPLACEHOLDER=value; Via configuration ...
Read more >
Configuring the Commerce Engine using environment variables
The Commerce Engine uses placeholders in configuration and environment files, instead of actual values. The configuration values are defined as ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found