ara icon indicating copy to clipboard operation
ara copied to clipboard

database: consider jsonfield with django >= 3.1

Open dmsimard opened this issue 5 years ago • 3 comments

What component is this about ?

database model, potentially requiring API changes

What is the idea ?

We are not ready to upgrade Django yet (waiting for the next LTS) but django 3.1 was just released with jsonfield support for all database backends whereas it was only compatible with postgresql before: https://docs.djangoproject.com/en/3.1/releases/3.1/#jsonfield-for-all-supported-database-backends

Since a lot of things from Ansible is JSON, this could help us simplify the database schema and also make the fields easily searchable -- I'm thinking like searching through results, host facts or CLI arguments, for example.

dmsimard avatar Aug 04 '20 12:08 dmsimard

3.2 LTS is out: https://www.djangoproject.com/weblog/2021/apr/06/django-32-released/

dmsimard avatar Apr 06 '21 11:04 dmsimard

WIP upgrade to django 3.2: https://github.com/ansible-community/ara/pull/360

dmsimard avatar Feb 28 '22 17:02 dmsimard

By the way, documentation from django and django-rest-framework on jsonfield:

  • https://docs.djangoproject.com/en/3.2/ref/models/fields/#jsonfield
  • https://www.django-rest-framework.org/api-guide/fields/#jsonfield
  • https://www.django-rest-framework.org/api-guide/filtering/#searchfilter

dmsimard avatar May 20 '22 01:05 dmsimard