Re: Migration Issue in Django 1.9

2018-11-12 Thread china
Hi Andreas, I have fixed the issue. Here is how i achieved 1. I removed the field reports_to and added a field report_new(with foreign key) - reports_to = models.CharField(max_length=128, blank=True, null= True)---(Removed this line) + report_new = models.ForeignKey(

Re: Migration Issue in Django 1.9

2018-11-12 Thread Andréas Kühne
Hi, Yes you can roll back your migrations (I think) But you weren't able to get by that migration and it's only that migration that you need to handle. The other migrations haven't yet been migrated and you can just delete them from your disk in that case? Regards, Andréas Den mån 12 nov.

Re: Migration Issue in Django 1.9

2018-11-12 Thread china
Hi Andreas, Thank you for you quick response Is it possible if remove my migration files and rollback my migration to three migrations back..? Thanks, Karthik On Monday, November 12, 2018 at 12:26:23 PM UTC-5, Andréas Kühne wrote: > > Hi, > > You are changing a CharField into a ForeignKey fie

Re: Migration Issue in Django 1.9

2018-11-12 Thread Andréas Kühne
Hi, You are changing a CharField into a ForeignKey field with data present. So when the migration tries to run, the reports_to field contains information with a string in it - the database server then tries to set it to a ForeignKey field, which is an integer field per default. This data migration

Migration Issue in Django 1.9

2018-11-12 Thread china
Hi Experts, I am trying to change the charfield to ForeignKey and I am running my code I am getting the following error if do python manage.py migrate django.db.utils.DataError: invalid input syntax for integer: "Jeff" Here is my code BEFORE -- reports_to = models.CharField(max_length