Skip to content

Commit 6f02fda

Browse files
docs: update phone number
1 parent 9970e91 commit 6f02fda

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,21 @@ References:
262262
- https://openid.net/specs/openid-connect-core-1_0.html#zoneinfo
263263

264264
## Data Type: Phone number
265-
265+
Phone numbers are usually stored as E.164.
266266
```sql
267267
phone_number VARCHAR(32) NOT NULL DEFAULT '',
268268
phone_number_verified BOOLEAN NOT NULL DEFAULT 0,
269269
```
270+
271+
TL;DR, don't store phone number as bigint, as trailing zeros will break it.
270272
References:
271273
- https://en.wikipedia.org/wiki/Telephone_numbering_plan
272274
- https://boards.straightdope.com/sdmb/showthread.php?t=417024
273275
https://stackoverflow.com/questions/723587/whats-the-longest-possible-worldwide-phone-number-i-should-consider-in-sql-varc
276+
- [Google: Falsehoods Programmers Believe About Phone Numbers](https://github.com/google/libphonenumber/blob/master/FALSEHOODS.md)
277+
- https://dba.stackexchange.com/questions/164796/how-do-i-store-phone-numbers-in-postgresql
278+
- https://www.mayerdan.com/programming/2017/06/26/db_phone_types
279+
- [Twillio: What is E.164?](https://www.google.com/search?q=twillio+e164&oq=twillio+e164&aqs=chrome..69i57j0i13.3516j0j4&sourceid=chrome&ie=UTF-8)
274280

275281
## Data Type: Name
276282
Longest name (225 characters)

0 commit comments

Comments
 (0)