Environment
Logged in staging, verified locally in entitycore 2026.4.0.
Description
The brain-region endpoint fails with some filters:
http://127.0.0.1:8000/brain-region?semantic_search=thalamus&page=1&page_size=10&id=e3e70682-c209-4cac-a29f-6fbed82c07cd&hierarchy_id=e3e70682-c209-4cac-a29f-6fbed82c07cd&order_by=name&species__id=e3e70682-c209-4cac-a29f-6fbed82c07cd&strain__id=e3e70682-c209-4cac-a29f-6fbed82c07cd
-> sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DuplicateAlias) table name "brain_region_hierarchy" specified more than once
http://127.0.0.1:8000/brain-region?strain__id=e3e70682-c209-4cac-a29f-6fbed82c07cd
-> sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) missing FROM-clause entry for table "species"
To Reproduce
Call the urls above.
Expected behavior
Return the json payload with the list of results.
Acceptance criteria
Environment
Logged in staging, verified locally in entitycore 2026.4.0.
Description
The brain-region endpoint fails with some filters:
http://127.0.0.1:8000/brain-region?semantic_search=thalamus&page=1&page_size=10&id=e3e70682-c209-4cac-a29f-6fbed82c07cd&hierarchy_id=e3e70682-c209-4cac-a29f-6fbed82c07cd&order_by=name&species__id=e3e70682-c209-4cac-a29f-6fbed82c07cd&strain__id=e3e70682-c209-4cac-a29f-6fbed82c07cd->
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DuplicateAlias) table name "brain_region_hierarchy" specified more than oncehttp://127.0.0.1:8000/brain-region?strain__id=e3e70682-c209-4cac-a29f-6fbed82c07cd->
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) missing FROM-clause entry for table "species"To Reproduce
Call the urls above.
Expected behavior
Return the json payload with the list of results.
Acceptance criteria