In my models.py, i have some models with this kind of attributes:
timestamp = models.TimeField(default=0)
I want to change them to:
timestamp = models.DateTimeField(default=0)
Using
python manage.py schemamigration app --auto
works in first instance. But
python manage.py migrate app
leads to this error:
django.db.utils.ProgrammingError: column "timestamp" cannot be cast to type timestamp with time zone
So i somehow needs to make this casting possible. For every time without date i want to set a default date (e.g. yesterday). How can i do this? I only found this on SO, which does not help at all because of that error. BTW: I am using postgres and python3.
I appreciate your help!
It is okay for me to use SQL direct on the database (without south) if that's easier