Reputation: 524
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 types for existing models preserving old field names and without loosing any data. Thanks.
Upvotes: 1
Views: 1838
Reputation: 7404
What you want to do is a data migration.
jsonfield
and add the new PostreSQL JSONField
.Upvotes: 2
Reputation: 625
yes you can change fields' types and names without loosing the data.
You just need to run makemigrations
and migrate
every time you change something`in your models.py
Upvotes: 0