New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #4956 to 3-2-stable. Postgresql partial indices #11442

Closed
wants to merge 1 commit into
base: 3-2-stable
from

Conversation

Projects
None yet
3 participants
@nberger

nberger commented Jul 15, 2013

Backport #4956 to 3-2-stable.

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

Made schema dumper recognize partial indices' where statements

Backport #4956 to 3-2-stable. Postgresql partial indices
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

Made schema dumper recognize partial indices' where statements
@rafaelfranca

This comment has been minimized.

Member

rafaelfranca commented Jul 15, 2013

Thank you so much. This is a new feature and new features can not be added on the 3-2-stable branch

@nberger

This comment has been minimized.

nberger commented Jul 15, 2013

Ok, no problem. Sorry for not observing the new features policy for this branch.

For reference, I tried using pg_power to create a partial unique index, and it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment