Hi,
I want to add a migration to create an index using btree , googled a
little but couldn’t find anything thats relevant.
is this possible in rails ? or is there a work around ?
appreciate your help , thanks
-CG
Hi,
I want to add a migration to create an index using btree , googled a
little but couldn’t find anything thats relevant.
is this possible in rails ? or is there a work around ?
appreciate your help , thanks
-CG
On Nov 3, 9:46 pm, Geekforaday-Learnerforlifetime
[email protected] wrote:
Hi,
I want to add a migration to create an index using btree , googled a
little but couldn’t find anything thats relevant.is this possible in rails ? or is there a work around ?
appreciate your help , thanks
-CG
I think btree is a fairly common default. For instance it’s the
default in postgres, right?
So if you just used the rails ‘add_index’ you’d get a btree index.
It looks like add_index doesn’t pass on extra options though (there
might be some
method that does this in rails I just don’t know it). So if you needed
to
specify the index method, you might have to execute the sql manually
in your migration.
YourARClass.connection.execute(‘CREATE INDEX … USING btree…’)
You’ll have to consult your db docs to establish its capabilities and
sql to use.
–
Daniel B.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs