Download the PHP package intaro/custom-index-bundle without Composer
On this page you can find all versions of the php package intaro/custom-index-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download intaro/custom-index-bundle
More information about intaro/custom-index-bundle
Files in intaro/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 attribute with entity definition and console command.
Installation
CustomIndexBundle requires Symfony 5 or higher. Works only with PostgreSQL.
Run into your project directory:
Register the bundle in config/bundles.php:
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.
Parameter allowed_index_types helps to exclude some types of indexes. If someone will try to use excluded type, command intaro:doctrine:index:update will return an error.
Default value is ['gin', 'gist', 'btree', 'hash'].
Usage
1) Add attributes in your entity
Available CustomIndex properties:
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 toUSINGdirective in PostgreSQLCREATE INDEXcommand.where- corresponds toWHEREdirective in PostgreSQLCREATE INDEXcommand.
Required only columns property.
2) Use intaro:doctrine:index:update command for update db.
You may use dump-sql parameter for dump sql with DROP/CREATE INDEX commands
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.2.3 || ^3.0
symfony/config Version ^5.0 || ^6.0
symfony/console Version ^5.0 || ^6.0
symfony/dependency-injection Version ^5.0 || ^6.0
symfony/http-kernel Version ^5.0 || ^6.0
symfony/validator Version ^5.0 || ^6.0