Re: Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-21 Thread Martin Kapfhammer
Alright, so I uncommented the creation of the CharField and changed the AlterField to an AddField operation. Worked! :) Thank you -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it,

Re: Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-20 Thread George Silva
check merge migrations. some migrations the framework will combine whenever possible. Em 20/02/2015 17:15, "Martin Kapfhammer" escreveu: > Yep, I can drop the column and create a new one as integer. > The only problem I have is that creating the field as a char was in > migration number 0020, cha

Re: Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-20 Thread Martin Kapfhammer
Yep, I can drop the column and create a new one as integer. The only problem I have is that creating the field as a char was in migration number 0020, changing it to a foreign key was in migration number 0028 and now I have already 0036 migrations. Therefore I have to "hang in" the dropping and

Re: Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-20 Thread George Silva
The deal here is that the model Currency has an ID, which is well, integer. Your data that is already on that column, is char (original field). If you are not in production, I would recommend dropping the field (comment the code), make migrations and apply. that will remove the currency column. Th

Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-20 Thread Martin Kapfhammer
First I created a CharField: ('currency', models.CharField(max_length=30)), In a later migration I changed it to a foreign key field: field=models.ForeignKey(to='web.Currency'), It worked on a local MySql instance, but not on Postgres on Heroku: django.db.utils.ProgrammingError: column "cur