Change_column Oracle index limit

I’m trying to execute a simply change_column on oracle, with the
following output:
– change_column(:comments, :text, :string, {:limit=>1000})
rake aborted!
An error has occurred, this and all later migrations canceled:

Index name
‘temp_index_altered_comments_on_commentable_id_and_commentable_type’
on table ‘altered_comments’ is too long; the limit is 64 characters

How do I specify the name of the temporary index in the migration?

On Mon, Aug 15, 2011 at 1:41 PM, theLemcke [email protected]
wrote:

Index name
‘temp_index_altered_comments_on_commentable_id_and_commentable_type’
on table ‘altered_comments’ is too long; the limit is 64 characters

How do I specify the name of the temporary index in the migration?

e.g.

add_index :things , :thing_id , :name => ‘thing_index’


Hassan S. ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan

Yes, but how do I do this with change_column?

On Aug 15, 1:53pm, Hassan S. [email protected]

On Mon, Aug 15, 2011 at 3:06 PM, theLemcke [email protected]
wrote:

Yes, but how do I do this with change_column?

No idea, and I doubt you can :slight_smile:

Can you post the migration itself and the current schema for the table?


Hassan S. ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan

You know what? Nevermind. Turns out that table is deleted later in my
migrations, so I’ll just comment this line out. Still would like to
know how to do this, if it’s even possible.

On Aug 15, 3:17pm, Hassan S. [email protected]

On Aug 15, 6:58pm, theLemcke [email protected] wrote:

You know what? Nevermind. Turns out that table is deleted later in my
migrations, so I’ll just comment this line out. Still would like to
know how to do this, if it’s even possible.

It looks like the issue is an index established earlier on
commentable_id and commentable_type - Oracle appears to be copying
the whole deal to a temporary table (altered_comments) along with the
indexes. I suspect the only solution would be to shorten the name of
the index on the original table before doing the change_column…

–Matt J.