You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have country = CountryField(multiple=True)
somewhere in my open source project.
We have migration that has max_length=749.
But then someone adds (before running migration) COUNTRIES_ONLY=["US"].
Because of this settings the Django will migrate this to max_length=2 (instead of 749). If we remove this settings, no new migration will be made. We are stuck with max_length=2.
To add more:
multiple=True implementation could be better, we could use ArrayField (for postgres only).
max_length is only a DB validation option, it does not impact memory/storage use, if we really want to use CharField just omit max_length (use TextField).
The text was updated successfully, but these errors were encountered:
It does seem like a bug that there's no second migration made.
Using ArrayField for a specific DB, or TextField (which although is pretty much identical in Postgres, does have differences in MySQL) are neither options that I'm thrilled about
Let's say I have
country = CountryField(multiple=True)
somewhere in my open source project.
We have migration that has
max_length=749
.But then someone adds (before running migration)
COUNTRIES_ONLY=["US"]
.Because of this settings the Django will migrate this to
max_length=2
(instead of 749). If we remove this settings, no new migration will be made. We are stuck with max_length=2.To add more:
multiple=True implementation could be better, we could use ArrayField (for postgres only).
max_length is only a DB validation option, it does not impact memory/storage use, if we really want to use CharField just omit max_length (use TextField).
The text was updated successfully, but these errors were encountered: