﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24264	foreign key constraint error migrating integer pk to CharField	Tim Graham	Markus Holtermann	"Discovered while trying to update djangoproject.com to 1.8a1. See https://github.com/django/djangoproject.com/pull/373 for steps to reproduce.
{{{
$ python manage.py test fundraising
...
foreign key constraint ""fundrais_donor_id_50d7dcbcff28bd90_fk_fundraising_djangohero_id"" cannot be implemented
DETAIL:  Key columns ""donor_id"" and ""id"" are of incompatible types: integer and character varying.
}}}

Bisected to bbbed99f6260a8b3e65cb990e49721b1ce4a441b

Here's a test for `tests/schema/tests.py` which is at least a start (it fails on 1.7.x too, so it's probably not quite right):
{{{
def test_change_int_pk_to_char(self):
    with connection.schema_editor() as editor:
        editor.create_model(Author)
        editor.create_model(Book)
    new_field = CharField(max_length=15, primary_key=True)
    new_field.set_attributes_from_name(""id"")
    new_field.model = Author
    with connection.schema_editor() as editor:
        editor.alter_field(Author, Author._meta.get_field(""id""), new_field)
}}}"	Bug	closed	Migrations	1.8alpha1	Release blocker	fixed		Markus Holtermann	Ready for checkin	1	0	0	0	0	0
