Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have some old running software connecting to the same SQL database as our new software. The old software do some stuff that ignores schema and as some of our tables has the same name as some of Hangfires it cause problems. I did also see two old pull request where someone where looking for something similar to this. (Pull request 1097 and 1301)
We have not upgraded Hangfire for a while, but we have used this since we started using Hangfire two years ago. I now updated our code base from the latest version and i figured i could share this, if this is interesting for someone else.
It is done in the quickest way possible (search and replace) and is probably not the best implementation, but it has been working for us. It's possible to create a better implementation (Example: Something that doesn't require manual add of the prefix before the table every time) but then i want to be sure that it is a feature that will be taken in consideration for the official version, before i put the time in to do so.
Quick about the implementation that is made so far. It's implemented in the same way custom scheme name is implemented. It has support for changing prefix over time as of now it is running when PrepareSchemaIfNecessary = true, maybe this should be moved to some other place or only run when EnableHeavyMigrations = true. Default there is no prefix. If prefix is set and tables do not correspond with prefix it will cause and exception at initialization of SQL storage.