I am using django along with southtut for my models. I added a column to one model: time, and I set it as a TimeField. I then ran python manage.py schemamigration southtut –auto, and when it was asking me for a default value, without thinking, I just entered 1. That worked out fine. Then I ran python manage.py migrate southtut, which raised the error: ValidationError: [u”‘1’ value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format.”] . I get why I have the error. But how do I get rid of that value 1? I can’t log into the admin site and delete because the column ‘time’ doesn’t exist. It doesn’t seem like I can do it running from the shell either, again, because there is no such column. But on the other hand, I can’t just add a different column; i.e., “realtime”, because the error ValidationError: [u”‘1’ value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format.”] still gets raised. So how exactly do I get rid of that value?
Share
To change the default value, just edit the migration file south created. It will be in
southtut/migrations/Alternatively, it may be easier to just delete the migration file then run
schemamigrationagain, but this time provide a valid default value. Because you didn’t successfully migrate, deleting the ‘bad’ migration file is harmless.