Explicit example of partial indexes
This commit is contained in:
parent
193e31f22a
commit
3caaf26069
@ -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
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user