From d70e0236df61d69c9299fe63df94da35c87ee2d8 Mon Sep 17 00:00:00 2001 From: Marcelo Silveira Date: Thu, 9 Feb 2012 01:20:52 -0200 Subject: 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 --- activerecord/CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'activerecord/CHANGELOG.md') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 69cf1193b6..3de5af22c5 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,18 @@ ## Rails 4.0.0 (unreleased) ## +* Added support for partial indices to PostgreSQL adapter + + 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 + + *Marcelo Silveira* + * Implemented ActiveRecord::Relation#none method The `none` method returns a chainable relation with zero records -- cgit v1.2.3