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.
Both MySQL and Postgres have a default max database name character length of 63 characters, if a branch name is longer than this the auto_copy operations and attempts to connect to the configured database will fail. Any names under 63 characters are not changed so no existing functionality is lost.
There seems to be a number of methods to shorten the name, but adding a unique id should prevent most conflicts. Since the id is generated as a Base64 MD5 hash key from the new full database name the key is not guaranteed unique, additionally the key will have all non-word characters converted to underscores and all characters converted to downcast to ensure compatibility with all databases and configurations. Even with these limitations, the chances of a conflict in names should be very slim considering the key is appended to a shortened version of the original database name. If anyone has any recommendations for a better method to handle this I'd be happy to implement it.