Skip to content
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

Explicit example of partial indexes #1232

Merged
merged 1 commit into from
Jan 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions docs/en/reference/annotations-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ Optional attributes:
- ``where``: SQL WHERE condition to be used for partial indexes. It will
only have effect on supported platforms.

Example:
Basic example:

.. code-block:: php

Expand All @@ -441,6 +441,19 @@ Example:
{
}

Example with partial indexes:

.. code-block:: php

<?php
/**
* @Entity
* @Table(name="ecommerce_products",indexes={@Index(name="search_idx", columns={"name", "email"}, options={"where": "(((id IS NOT NULL) AND (name IS NULL)) AND (email IS NULL))"})})
*/
class ECommerceProduct
{
}

.. _annref_id:

@Id
Expand Down Expand Up @@ -1168,7 +1181,7 @@ Optional attributes:
- ``where``: SQL WHERE condition to be used for partial indexes. It will
only have effect on supported platforms.

Example:
Basic example:

.. code-block:: php

Expand All @@ -1181,6 +1194,19 @@ Example:
{
}

Example with partial indexes:

.. code-block:: php

<?php
/**
* @Entity
* @Table(name="ecommerce_products",uniqueConstraints={@UniqueConstraint(name="search_idx", columns={"name", "email"}, options={"where": "(((id IS NOT NULL) AND (name IS NULL)) AND (email IS NULL))"})})
*/
class ECommerceProduct
{
}

.. _annref_version:

@Version
Expand Down