Changes between Version 2 and Version 12 of Ticket #25012
- Timestamp:
- Dec 29, 2020, 5:28:37 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #25012
- Property Component Uncategorized → Migrations
- Property Triage Stage Unreviewed → Accepted
- Property Type Uncategorized → Bug
- Property Cc added
- Property Keywords postgres removed
- Property Version 1.8 → master
- Property Summary Migration doesn't seem to detect foreignKey type changes → Migrations don't make foreign key type changes
-
Ticket #25012 – Description
v2 v12 1 1 Example: 2 2 3 {{{4 #!div style="font-size: 80%"5 {{{#!python6 class Foo(models.Model):7 id = models.AutoField() # Now change this to models.CharField(primary_key=True, max_length=...) and migrate, the migration doesn't complain8 3 9 class Bar(object): 10 foo = models.ForeignKey(Foo) # but Postgres will still say Bar.foo is an Integer value. 11 }}} 4 {{{#!python 5 class Foo(models.Model): 6 id = models.AutoField() # Now change this to models.CharField(primary_key=True, max_length=...) and migrate, the migration doesn't complain 7 8 class Bar(object): 9 foo = models.ForeignKey(Foo) # but Postgres will still say Bar.foo is an Integer value. 12 10 }}} 13 11 12 {{{ 14 13 DataError at /myapp/bar/add/ 15 14 invalid input syntax for integer: "TEST" 16 15 LINE 1: ...d") VALUES (NULL, 'TEST', ... 16 }}}