fab-geocommuns / RNB-coeur

Le coeur du Référentiel National des Bâtiments : imports, APIs, logique métier
https://rnb.beta.gouv.fr
Apache License 2.0
3 stars 0 forks source link

Suppression d'indexes #396

Closed fchabouis closed 3 months ago

fchabouis commented 3 months ago

Dans la même veine que #391 avec une autre colonne. Je n'ai pas pu le supprimer pour la colonne rnb_id à cause de la contrainte unique=Truequi créé les index en _like même si je mets index=False. Pareil pour la colonne address_id de batid_buildingaddressesreadonly qui est une foreign key. Mais ça fait toujours gagner 2 index.

Le sql généré par cette migration :

--
-- Alter field event_type on building
--
DROP INDEX IF EXISTS "batid_building_event_type_e0bdb167";
DROP INDEX IF EXISTS "batid_building_event_type_e0bdb167_like";
--
-- Alter field event_type on buildinghistoryonly
--
DROP INDEX IF EXISTS "batid_building_history_event_type_e745362c";
DROP INDEX IF EXISTS "batid_building_history_event_type_e745362c_like";
--
-- Concurrently create index bdg_event_type_idx on field(s) event_type of model building
--
CREATE INDEX CONCURRENTLY "bdg_event_type_idx" ON "batid_building" ("event_type");
--
-- Concurrently create index bdg_history_event_type_idx on field(s) event_type of model buildinghistoryonly
--
CREATE INDEX CONCURRENTLY "bdg_history_event_type_idx" ON "batid_building_history" ("event_type");