Django Jsonfield
We have been using JSONField from jsonfield library for a while, but now we want to use native PostgreSQL JSONField. So I would like to know whether it is possible to change field
Solution 1:
What you want to do is a data migration.
- Keep the existing
jsonfield
and add the newPostreSQL JSONField
. - Generate a data migration, which iterates through each record migrating the data from the old field to the new one.
- Once you've run the migration you can deprecate the old field and remove it without any data loss.
Post a Comment for "Django Jsonfield"