Adding table index through rails

Hello,
could someone please tell me how I can add a Mysql table index through
my rails app. without using a migration, ie from within my app ?

ie how I can call the add_index() method here >
ActiveRecord::ConnectionAdapters::SchemaStatements.add_index().

I don’t quite understand what I need to include or require for the
add_index method to become available for me to use.

thanks in advance,

Hal

Halvor Heuch wrote in post #949981:

Hello,
could someone please tell me how I can add a Mysql table index through
my rails app. without using a migration, ie from within my app ?

Why would you even want to do that? Normally the migrations are the
only part of your code that should change your DB schema, so I suspect
that you’ve either got very unusual needs or a design problem.

What are you ultimately trying to achieve here?

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs