Conversation
adds custom index method support in PostgreSQL
There was a problem hiding this comment.
I am not overly excited about this, but the syntax differs too much to apply this directly in the abstract adapter. :-(
|
nice! 👍 |
|
This will need a rebase, but I know lots of people (like @schneems and @tenderlove) are pumped about supporting specific postgres types. |
There was a problem hiding this comment.
I prefer
options.is_a? Hash
over
Hash === options
would also maybe change options[:method] => options[:method].blank? to protect against anyone using an empty string
There was a problem hiding this comment.
I agree about options.is_a? Hash, but I disagree about the check for blank?. I don't think we need to be so defensive.
|
I'm 👍 for this feature, being able to specify types of indexes is nice definitely better than having to go in and write it manually: I made a comment on code style, do you think you could fix that up, rebase this code, and we can get someone from ActiveRecord to take a look? |
|
Object#method(name) is defined. When trying to backport this to rails 3.2 it gave me a little grief. Can we pick a different name for it? The documentation seems to call it index_type for both postgres and my sql. While I don't like having the word index twice (IndexDefinition#index_type), it is more rails friendly than overriding Object#method. Unfortunately, the create index code currently uses an index_type variable to specify unique. IndexDefinition uses 'unique' for this purpose, so it is only a local variable in 2 places. But a side note none the less Thoughts? |
|
@kbrock Maybe just |
|
Heh, I notice in the mysql code, it is called :Index_type (with an uppercase i) So, what is needed to push this forward? |
|
@MSNexploder could you change to |
|
Totally forgot about this pull request... |
Conflicts: activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
|
👍 I want this feature to use Trigram full text search on postgresql. |
|
Perhaps this should be a |
|
@MSNexploder this will need to be squashed, and a CHANGELOG entry added. |
|
Closed in favor of #9451 |
Added add_index override in postgresql_adapter and mysql_adapters to allow custom index type support.
It's basically an updated version of this older pull request