Comment 0 for bug 1522498

Revision history for this message
Valentin Kaplov (vkaplov) wrote :

Actual state:
1. Now any JSON data stores in database as text, not as JSON.
2. We use nailgun.db.sqlalchemy.models.fields.JSON wrapper instead of native JSON type from sqlalchemy library

Expected state:
1. Any column in database should to be JSON type if it actually stores JSON data.
2. all nailgun.db.sqlalchemy.models objects should to use sqlalchemy.dialects.postgresql.JSON instead of wrapper
nailgun.db.sqlalchemy.models.fields.JSON

Action items:
In nailgun/db/sqlalchemy/models/fields.py define JSON type as sqlalchemy.dialects.postgresql.JSON. It would change JSON type everywhere where was used fields.JSON.

Setup JSON type for all database columns, that stores data in JSON format.
Example:
https://review.openstack.org/#/c/246390/16/nailgun/nailgun/db/migration/alembic_migrations/versions/fuel_8_0.py

Related bug: https://bugs.launchpad.net/fuel/+bug/1482399