Development #7357
models,a2_rbac/models: add partial indexes on models linked to ou or services
Start date:
26 May 2015
Due date:
% Done:
100%
Estimated time:
Patch proposed:
No
Planning:
Description
Django, SQLite and Postgres does not allow to create unique indexes on NULLable columns. It's technically possible using partial indexes looking like CREATE UNIQUE INDEX xxx ON table(col1, col2) WHERE col3 IS NULL
.
The slug of those models should be unique also when ou_id or service_id is NULL. Also add improved clean method to look for duplicates with better error messages.
Associated revisions
History
Updated by Benjamin Dauvergne over 7 years ago
- Status changed from Nouveau to Résolu (à déployer)
- % Done changed from 0 to 100
Appliqué par commit authentic2|996b975ae4ba8cada50f22a0c73b9b2fb282c2b3.
Updated by Benjamin Dauvergne almost 7 years ago
- Status changed from Résolu (à déployer) to Solution déployée
models,a2_rbac/models: add partial indexes on models linked to ou or services (fixes #7357)
The slug of those models should be unique also when ou_id or service_id
is NULL. Also add improved clean method to look for duplicates with
better error messages.