Hobo / hobo

The web app builder for Rails (moved from tablatom/hobo)
http://hobocentral.net
103 stars 39 forks source link

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

Open iox opened 10 years ago

iox commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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/Hobo/hobo/issues/65#issuecomment-33398328 .

enwood commented 10 years ago

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/Hobo/hobo/issues/65#issuecomment-33398328 .

iox commented 10 years ago

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 commented 10 years ago

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/Hobo/hobo/issues/65#issuecomment-33452881 .