mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #24447 -- Made migrations add FK constraints for existing columns
When altering from e.g. an IntegerField to a ForeignKey, Django didn't
add a constraint.
Backport of f4f0060fea from master
This commit is contained in:
committed by
Markus Holtermann
parent
7f2d60996c
commit
283b630d63
@@ -87,6 +87,15 @@ class BookWithM2M(models.Model):
|
||||
apps = new_apps
|
||||
|
||||
|
||||
class BookWithoutFK(models.Model):
|
||||
author = models.IntegerField()
|
||||
title = models.CharField(max_length=100, db_index=True)
|
||||
pub_date = models.DateTimeField()
|
||||
|
||||
class Meta:
|
||||
apps = new_apps
|
||||
|
||||
|
||||
class TagThrough(models.Model):
|
||||
book = models.ForeignKey("schema.BookWithM2MThrough")
|
||||
tag = models.ForeignKey("schema.TagM2MTest")
|
||||
|
||||
Reference in New Issue
Block a user