Opened 9 years ago
Last modified 4 years ago
#25012 closed Bug
Migration doesn't seem to detect foreignKey type changes — at Version 2
Reported by: | Hedde van der Heide | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | dev |
Severity: | Normal | Keywords: | migrations |
Cc: | Tyson Clugg, Samuel Bishop | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Example:
class Foo(models.Model): id = models.AutoField() # Now change this to models.CharField(primary_key=True, max_length=...) and migrate, the migration doesn't complain class Bar(object): foo = models.ForeignKey(Foo) # but Postgres will still say Bar.foo is an Integer value.
DataError at /myapp/bar/add/
invalid input syntax for integer: "TEST"
LINE 1: ...d") VALUES (NULL, 'TEST', ...
Change History (2)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
Description: | modified (diff) |
---|
Note:
See TracTickets
for help on using tickets.