Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cap database name length #6

Merged
merged 9 commits into from
Oct 21, 2015
Merged

Conversation

chaunce
Copy link
Contributor

@chaunce chaunce commented Aug 20, 2015

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.

naoty added a commit that referenced this pull request Oct 21, 2015
@naoty naoty merged commit d967820 into naoty:master Oct 21, 2015
@naoty
Copy link
Owner

naoty commented Oct 22, 2015

Released at 0.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants