Changes between Version 1 and Version 2 of Ticket #27676, comment 8


Ignore:
Timestamp:
Nov 28, 2023, 7:45:42 AM (5 months ago)
Author:
Tobias Krönke

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27676, comment 8

    v1 v2  
    88Same for CHAR and VARCHAR.
    99
    10 BTW, there is an annoying workaround for this for now: in a first migration, we add the new column by adding `my_field = models.TextField(blank=True, default=None)` and then we change it to `my_field = models.TextField(blank=True)` and generate another migration. And guess what, that 2nd migration is a `no-op`. That's because the `default` is actually only a django thing, not a DB thing.
     10BTW, there is an annoying workaround for this for now: in a first migration, we add the new column by adding `my_field = models.TextField(blank=True, default=None)` and then we change it to `my_field = models.TextField(blank=True)` and generate another migration. The 1st migration adds the column without default expression. And guess what, that 2nd migration is a `no-op`. That's because the `default` is actually only a django thing, not a DB thing.
Back to Top