﻿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
34151	django.db.migrations doesn't update *_id column data type in related table when changing pk type of linked models.	STANISLAV LEPEKHOV	nobody	"Hello!
When i changed this models:

{{{
class StoreChain(models.Model):
    places = models.ManyToManyField(Place, blank=True)

class Place(models.Model):
    uid = models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, unique=True)
}}}

to this edition (set pk with uuid type):
{{{
class StoreChain(models.Model):
    uid = models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, unique=True)
    places = models.ManyToManyField(Place, blank=True)

class Place(models.Model):
    uid = models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, unique=True)
}}}

Django creates a migration file that affects only the model tables, while the relationship table remains unchanged, which will cause an error, because the data type of the _ID fields in it also needs to be changed:
[[Image(https://i.ibb.co/XZYjvYp/hU0HJyqF.jpg)]]"	Bug	new	Core (Management commands)	4.1	Normal		migrations pk uuid relation		Unreviewed	0	0	0	0	1	0
