Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COUNTRIES_ONLY and migrations. #300

Open
drozdowsky opened this issue Mar 17, 2020 · 1 comment
Open

COUNTRIES_ONLY and migrations. #300

drozdowsky opened this issue Mar 17, 2020 · 1 comment

Comments

@drozdowsky
Copy link

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).

@SmileyChris
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants