aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
diff options
context:
space:
mode:
authorMarcelo Silveira <marcelo@mhfs.com.br>2012-02-09 01:20:52 -0200
committerMarcelo Silveira <marcelo@mhfs.com.br>2012-02-09 01:20:52 -0200
commitd70e0236df61d69c9299fe63df94da35c87ee2d8 (patch)
tree50af271dab628625e95849345b7312c1d9dca50e /activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
parent12c3b3d65738eccb7b7a043b2a8a1ba65a46d34e (diff)
downloadrails-d70e0236df61d69c9299fe63df94da35c87ee2d8.tar.gz
rails-d70e0236df61d69c9299fe63df94da35c87ee2d8.tar.bz2
rails-d70e0236df61d69c9299fe63df94da35c87ee2d8.zip
Added where option to add_index to support postgresql partial indices
The `add_index` method now supports a `where` option that receives a string with the partial index criteria. add_index(:accounts, :code, :where => "active") Generates CREATE INDEX index_accounts_on_code ON accounts(code) WHERE active
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_adapter.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
index edea414db7..dd421b2054 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -142,6 +142,11 @@ module ActiveRecord
false
end
+ # Does this adapter support partial indices?
+ def supports_partial_index?
+ false
+ end
+
# Does this adapter support explain? As of this writing sqlite3,
# mysql2, and postgresql are the only ones that do.
def supports_explain?