on `add_entity_type` in CubicWeb it seems that __unique_together__ is ignored and the constraint not created
As reported by @emartinet on riot, it seems that when a new entity is added using add_entity_type
in CubicWeb the __unique_together__
field is ignore and the constraint related to it isn't created while, when generating the schema the first time the constraint is correctly applied.
Those assumptions have been tested by @emartinet
Some related links into our projects:
- in YAMS where unique_together is detected https://forge.extranet.logilab.fr/open-source/yams/blob/c37badc51adf56175e233d3b32f1898c0366217d/yams/schema.py#L264
- in CubicWeb where it is taken into account when generating SQL https://forge.extranet.logilab.fr/cubicweb/cubicweb/blob/8b92fdfbbb94b9a25a70f23be75434bef273f2ea/cubicweb/server/schema2sql.py#L97 https://forge.extranet.logilab.fr/cubicweb/cubicweb/blob/8b92fdfbbb94b9a25a70f23be75434bef273f2ea/cubicweb/server/schema2sql.py#L162-164
- the related call inside logilab-database https://forge.extranet.logilab.fr/open-source/logilab-database/blob/017334dac24ca86eb779bef1c61fce51af0ec003/logilab/database/__init__.py#L890-898
-
add_entity_type
definition inside CW https://forge.extranet.logilab.fr/cubicweb/cubicweb/blob/8b92fdfbbb94b9a25a70f23be75434bef273f2ea/cubicweb/schema.py#L1017-1035 -
add_entity_type
definition inside YAMS https://forge.extranet.logilab.fr/open-source/yams/blob/c37badc51adf56175e233d3b32f1898c0366217d/yams/schema.py#L1440-1459