Fix PHONE.csv import duplicate constraint error
- Implement upsert logic in import_phone() function - Check for existing (id, phone) combinations before insert - Track duplicates within CSV to skip gracefully - Update existing records instead of failing on duplicates - Add detailed statistics: inserted, updated, skipped counts - Align with upsert pattern used in other import functions - Add documentation in docs/PHONE_IMPORT_FIX.md Fixes: UNIQUE constraint failed: phone.id, phone.phone error when re-importing or uploading CSV with duplicate entries
This commit is contained in:
53
data-import/unknown_94d488d7-6140-4881-acde-7ecbefe46e70.csv
Normal file
53
data-import/unknown_94d488d7-6140-4881-acde-7ecbefe46e70.csv
Normal file
@@ -0,0 +1,53 @@
|
||||
Abrev,St
|
||||
AK,Alaska
|
||||
AL,Alabama
|
||||
AR,Arkansas
|
||||
AZ,Arizona
|
||||
CA,California
|
||||
CO,Colorado
|
||||
CT,Connecticut
|
||||
DC,DC
|
||||
DE,Delaware
|
||||
FL,Florida
|
||||
GA,Georgia
|
||||
HI,Hawaii
|
||||
IA,Iowa
|
||||
ID,Idaho
|
||||
IL,Illinois
|
||||
IN,Indiana
|
||||
KS,Kansas
|
||||
KY,Kentucky
|
||||
LA,Louisiana
|
||||
MA,Massachusetts
|
||||
MD,Maryland
|
||||
ME,Maine
|
||||
MI,Michigan
|
||||
MN,Minnesota
|
||||
MO,Missouri
|
||||
MS,Mississippi
|
||||
MT,Montana
|
||||
NC,North Carolina
|
||||
ND,North Dakota
|
||||
NE,Nebraska
|
||||
NH,New Hampshire
|
||||
NJ,New Jersey
|
||||
NM,New Mexico
|
||||
NV,Nevada
|
||||
NY,New York
|
||||
OH,Ohio
|
||||
OK,Oklahoma
|
||||
OR,Oregon
|
||||
PA,Pennsylvania
|
||||
PR,Puerto Rico
|
||||
RI,Rhode Island
|
||||
SC,South Carolina
|
||||
SD,South Dakota
|
||||
TN,Tennessee
|
||||
TX,Texas
|
||||
UT,Utah
|
||||
VA,Virginia
|
||||
VT,Vermont
|
||||
WA,Washington
|
||||
WI,Wisconsin
|
||||
WV,West Virginia
|
||||
WY,Wyoming
|
||||
|
Reference in New Issue
Block a user