Giter Club home page Giter Club logo

Comments (3)

stefanfoulis avatar stefanfoulis commented on June 30, 2024

The value is just so hight to definitely be large enough for all phone numbers. And didn't see a performance impact in just setting it at this size. I guess something like 32 would have been enough as well.
Annoyingly this is not easy to change in hindsight. If we just change the value here, people using this field in re-usable apps will produce different database migrations based on which version of django-phonenumber-field they happen to have had installed when they created their migration. So it is likely that people will get warnings about missing migrations in a re-usable app (which they don't have control over), if they upgrade django-phonenumber-field in their project.

IMHO there is no significant performance reason to go through that hassle for this change. But I'm no database expert, so I may be wrong :-)

from django-phonenumber-field.

chronossc avatar chronossc commented on June 30, 2024

You are right, it don't have penalty on performance because CharField use varchar in MySQL and PostgreSQL at least and so use only necessary bytes, I agree that isn't needed to change the field size, but a comment on code or docs about the size would be nice (maybe that issue will work as documentation too). Anyway I was more curious about why use that size :D.

Thx for reply and btw, good job u have done in this fields 👍 .

from django-phonenumber-field.

kevin-brown avatar kevin-brown commented on June 30, 2024

instead something like 20 (1 for +, 3 for country code, 3 for area code, 13 for phone digits).

You're missing extensions to phone numbers in there (;ext=123) and also that some people use formats other than E164 for the database.

from django-phonenumber-field.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.