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

Limit index names to 63 characters to facilitate changing databases #65

Open
iox opened this issue Jan 27, 2014 · 5 comments
Open

Limit index names to 63 characters to facilitate changing databases #65

iox opened this issue Jan 27, 2014 · 5 comments
Milestone

Comments

@iox
Copy link
Member

iox commented Jan 27, 2014

Postgresql: 63
Mysql: 64
Sqlite: 64

When a user goes from sqlite or mysql to postgresql, they might face weird errors. Tim proposed limiting all index to a maximum of 63 characters, and I think it's a great idea.

https://groups.google.com/forum/#!topic/hobousers/d7y2LydE1y8

@bryanlarsen
Copy link
Member

Oracle has some sort of silly limit. 32, IIRC. Anybody using rails/hobo on Oracle pretty much has to specify all of their index names manually.

@enwood
Copy link

enwood commented Jan 27, 2014

Thanks, Bryan.

I guess what's ultimately missing is the ability to override or
intervene/suggest a Hobo-generated index name for the migration generator.

T

On Mon, Jan 27, 2014 at 12:23 PM, Bryan Larsen notifications@github.comwrote:

Oracle has some sort of silly limit. 32, IIRC. Anybody using rails/hobo on
Oracle pretty much has to specify all of their index names manually.


Reply to this email directly or view it on GitHubhttps://github.com//issues/65#issuecomment-33398328
.

@enwood
Copy link

enwood commented Jan 27, 2014

Whoops, yes, I forgot you can do this:

belongs_to :other_related_instrument, :class_name => "Instrument",
:index => "my_not_so_long_index_name"

That'll teach me to use really verbose class names.

T

On Mon, Jan 27, 2014 at 1:14 PM, Tim Griffin tech@enwood.ca wrote:

Thanks, Bryan.

I guess what's ultimately missing is the ability to override or
intervene/suggest a Hobo-generated index name for the migration generator.

T

On Mon, Jan 27, 2014 at 12:23 PM, Bryan Larsen notifications@github.comwrote:

Oracle has some sort of silly limit. 32, IIRC. Anybody using rails/hobo
on Oracle pretty much has to specify all of their index names manually.


Reply to this email directly or view it on GitHubhttps://github.com//issues/65#issuecomment-33398328
.

@iox
Copy link
Member Author

iox commented Jan 28, 2014

Mmm, I didn't know that about Oracle, and I had not renamed any index :P. What do you think if we close this issue and leave Hobo as it is?

@enwood
Copy link

enwood commented Jan 28, 2014

Yes, I admit, it's an obscure scenario unless you like using long,
description model names like I do AND you happen to want to switch
databases. It was an easy fix, and one I could have avoided had I not
relied on Hobo's automatic index naming, and used the :index => parameter
on my belongs_to statements.

T

On Tue, Jan 28, 2014 at 12:46 AM, Ignacio Huerta
notifications@github.comwrote:

Mmm, I didn't know that about Oracle, and I had not renamed any index :P.
What do you think if we close this issue and leave Hobo as it is?


Reply to this email directly or view it on GitHubhttps://github.com//issues/65#issuecomment-33452881
.

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

No branches or pull requests

3 participants