diff --git a/CHANGELOG.md b/CHANGELOG.md index 981388fdc..07b99a923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to * [task]: fix dropdown menu style + fix bug in singleTaskController (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/338) * Household: fix bug when moving person on the same day (see https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/281) * Household: show date validFrom and validTo when moving +* address reference: add index for refid ## Test releases diff --git a/src/Bundle/ChillMainBundle/Entity/AddressReference.php b/src/Bundle/ChillMainBundle/Entity/AddressReference.php index 99efd391d..a9d421fcb 100644 --- a/src/Bundle/ChillMainBundle/Entity/AddressReference.php +++ b/src/Bundle/ChillMainBundle/Entity/AddressReference.php @@ -17,7 +17,9 @@ use Symfony\Component\Serializer\Annotation\Groups; /** * @ORM\Entity - * @ORM\Table(name="chill_main_address_reference") + * @ORM\Table(name="chill_main_address_reference", indexes={ + * @ORM\Index(name="address_refid", columns={"refId"}, options={"where": "refid != ''"}) + * }) * @ORM\HasLifecycleCallbacks */ class AddressReference diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211216213649.php b/src/Bundle/ChillMainBundle/migrations/Version20211216213649.php new file mode 100644 index 000000000..4e5e4d9d9 --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20211216213649.php @@ -0,0 +1,33 @@ +addSql('DROP INDEX address_refid'); + } + + public function getDescription(): string + { + return 'add an index on address reference refid'; + } + + public function up(Schema $schema): void + { + $this->addSql('CREATE INDEX address_refid ON chill_main_address_reference (refId) WHERE refid != \'\''); + } +}