Download the PHP package wobal/custom-index-bundle without Composer
On this page you can find all versions of the php package wobal/custom-index-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wobal/custom-index-bundle
More information about wobal/custom-index-bundle
Files in wobal/custom-index-bundle
Package custom-index-bundle
Short Description Annotation and command for control entity custom indexes
License MIT
Informations about the package custom-index-bundle
CustomIndexBundle
The CustomIndexBundle allows create index for doctrine entities using annotation with entity definition and console command.
Installation
CustomIndexBundle requires Symfony 2.1 or higher. Now work only with PostgreSQL.
Require the bundle in your composer.json
file:
Install the bundle:
Register the bundle in AppKernel
:
If your project have many schemas in single database and command must generate custom indexes only for one schema then add in your config.yml
:
Default value of search_in_all_schemas
is true
.
If you have different entities in different schemas and you need to update custom indexes in all schemas at once then you must set search_in_all_schemas
to true
or omit this config.
If you have database with only public schema then search_in_all_schemas
value doesn't matter.
Usage
1) Add annotation in your entity
Available CustomIndex attributes:
columns
- array of the table columnsname
- index name (default ='i_cindex_<md5 hash from all CustomIndex attributes>'
).unique
- index is unique (default = false).using
- corresponds toUSING
directive in PostgreSQLCREATE INDEX
command.where
- corresponds toWHERE
directive in PostgreSQLCREATE INDEX
command.
Required only columns
attribute.
2) Use intaro:doctrine:index:update
command for update db.
You may use dump-sql
parameter for dump sql with DROP/CRATE INDEX
commands
Some annotation examples
Create index using pg_trgm
extension:
Create unique index using PostgreSQL functions:
Create partial index:
All versions of custom-index-bundle with dependencies
doctrine/orm Version ^2.5
doctrine/dbal Version ^3.0
symfony/config Version ^4.1
symfony/console Version ^4.1
symfony/dependency-injection Version ^4.1
symfony/http-kernel Version ^4.1
symfony/validator Version ^4.1