Changes between Version 2 and Version 12 of Ticket #25012


Ignore:
Timestamp:
Dec 29, 2020, 5:28:37 PM (4 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25012

    • Property Component UncategorizedMigrations
    • Property Triage Stage UnreviewedAccepted
    • Property Type UncategorizedBug
    • Property Cc Tyson Clugg Samuel Bishop added
    • Property Keywords postgres removed
    • Property Version 1.8master
    • Property Summary Migration doesn't seem to detect foreignKey type changesMigrations don't make foreign key type changes
  • Ticket #25012 – Description

    v2 v12  
    11Example:
    22
    3 {{{
    4     #!div style="font-size: 80%"
    5     {{{#!python
    6     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 complain   
    83
    9     class Bar(object):
    10         foo = models.ForeignKey(Foo)  # but Postgres will still say Bar.foo is an Integer value.
    11     }}}
     4{{{#!python
     5class 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
     8class Bar(object):
     9    foo = models.ForeignKey(Foo)  # but Postgres will still say Bar.foo is an Integer value.
    1210}}}
    1311
     12{{{
    1413DataError at /myapp/bar/add/
    1514invalid input syntax for integer: "TEST"
    1615LINE 1: ...d") VALUES (NULL, 'TEST', ...
     16}}}
Back to Top