I had a Django model defined as:
from users.models import User
class Record(models.Model):
user = models.ForeignKey(
User,
on_delete=SET_NULL,
null=True)
...
I realized that it would be better to rewrite the above model as:
from userprofile.models import UserProfile
class Record(models.Model):
user = models.ForeignKey(
UserProfile,
on_delete=SET_NULL,
null=True)
....
How can I migrate (so the new definition of the model Record) is used, without having to lose the old Record instances in the databases? What is the general process of such migrations? Because if I migrate with the new definition of Record, I lose access to the old Record objects so I can't update them. However, if I don't migrate, Django won't let me use UserProfile as the user field.