dipeshsukhia / laravel-country-state-city-data

World`s Country State City Data Provider for Laravel
MIT License
79 stars 22 forks source link

Duplicated and wrong data for a state #9

Closed danieletulone closed 3 years ago

danieletulone commented 4 years ago
{
        "id": 1802,
        "country_id": 107,
        "name": "abruzzi"
}

This data is wrong. The only correct is the data with id 1803.

dasundev commented 3 years ago

There is a problem with CountryStateCityTableSeeder.php

Seeding: Database\Seeders\CountryStateCityTableSeeder

Illuminate\Database\QueryException

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY' (SQL: insert into countries (id, name) values (1, afghanistan), (2, albania), (3, algeria), (4, american samoa), (5, andorra), (6, a ngola), (7, anguilla), (8, antarctica), (9, antigua and barbuda), (10, argentina), (11, armenia), (12, aruba), (13, australia), (14, austria), (15, azerbaijan), (16, bahamas the), (17, bahrain), (18, bangladesh), (19, barbados), (20 , belarus), (21, belgium), (22, belize), (23, benin), (24, bermuda), (25, bhutan), (26, bolivia), (27, bosnia and herzegovina), (28, botswana), (29, bouvet island), (30, brazil), (31, british indian ocean territory), (32, brunei), ( 33, bulgaria), (34, burkina faso), (35, burundi), (36, cambodia), (37, cameroon), (38, canada), (39, cape verde), (40, cayman islands), (41, central african republic), (42, chad), (43, chile), (44, china), (45, christmas island), (4 6, cocos (keeling) islands), (47, colombia), (48, comoros), (49, congo), (50, congo the democratic republic of the), (51, cook islands), (52, costa rica), (53, cote d'ivoire (ivory coast)), (54, croatia (hrvatska)), (55, cuba), (56, cyprus), (57, czech republic), (58, denmark), (59, djibouti), (60, dominica), (61, dominican republic), (62, east timor), (63, ecuador), (64, egypt), (65, el salvador), (66, equatorial guinea), (67, eritrea), (68, estonia), (69, et hiopia), (70, external territories of australia), (71, falkland islands), (72, faroe islands), (73, fiji islands), (74, finland), (75, france), (76, french guiana), (77, french polynesia), (78, french southern territories), (79, gab on), (80, gambia the), (81, georgia), (82, germany), (83, ghana), (84, gibraltar), (85, greece), (86, greenland), (87, grenada), (88, guadeloupe), (89, guam), (90, guatemala), (91, guernsey and alderney), (92, guinea), (93, guinea-b issau), (94, guyana), (95, haiti), (96, heard and mcdonald islands), (97, honduras), (98, hong kong s.a.r.), (99, hungary), (100, iceland), (101, india), (102, indonesia), (103, iran), (104, iraq), (105, ireland), (106, israel), (10 7, italy), (108, jamaica), (109, japan), (110, jersey), (111, jordan), (112, kazakhstan), (113, kenya), (114, kiribati), (115, korea north), (116, korea south), (117, kuwait), (118, kyrgyzstan), (119, laos), (120, latvia), (121, leb anon), (122, lesotho), (123, liberia), (124, libya), (125, liechtenstein), (126, lithuania), (127, luxembourg), (128, macau s.a.r.), (129, macedonia), (130, madagascar), (131, malawi), (132, malaysia), (133, maldives), (134, mali), (135, malta), (136, man (isle of)), (137, marshall islands), (138, martinique), (139, mauritania), (140, mauritius), (141, mayotte), (142, mexico), (143, micronesia), (144, moldova), (145, monaco), (146, mongolia), (147, montserrat) , (148, morocco), (149, mozambique), (150, myanmar), (151, namibia), (152, nauru), (153, nepal), (154, netherlands antilles), (155, netherlands the), (156, new caledonia), (157, new zealand), (158, nicaragua), (159, niger), (160, ni geria), (161, niue), (162, norfolk island), (163, northern mariana islands), (164, norway), (165, oman), (166, pakistan), (167, palau), (168, palestinian territory occupied), (169, panama), (170, papua new guinea), (171, paraguay), (172, peru), (173, philippines), (174, pitcairn island), (175, poland), (176, portugal), (177, puerto rico), (178, qatar), (179, reunion), (180, romania), (181, russia), (182, rwanda), (183, saint helena), (184, saint kitts and nevi s), (185, saint lucia), (186, saint pierre and miquelon), (187, saint vincent and the grenadines), (188, samoa), (189, san marino), (190, sao tome and principe), (191, saudi arabia), (192, senegal), (193, serbia), (194, seychelles), (195, sierra leone), (196, singapore), (197, slovakia), (198, slovenia), (199, smaller territories of the uk), (200, solomon islands), (201, somalia), (202, south africa), (203, south georgia), (204, south sudan), (205, spain), (20 6, sri lanka), (207, sudan), (208, suriname), (209, svalbard and jan mayen islands), (210, swaziland), (211, sweden), (212, switzerland), (213, syria), (214, taiwan), (215, tajikistan), (216, tanzania), (217, thailand), (218, togo), (219, tokelau), (220, tonga), (221, trinidad and tobago), (222, tunisia), (223, turkey), (224, turkmenistan), (225, turks and caicos islands), (226, tuvalu), (227, uganda), (228, ukraine), (229, united arab emirates), (230, united kingdom), (231, united states), (232, united states minor outlying islands), (233, uruguay), (234, uzbekistan), (235, vanuatu), (236, vatican city state (holy see)), (237, venezuela), (238, vietnam), (239, virgin islands (british)), (240, virgin islands (us)), (241, wallis and futuna islands), (242, western sahara), (243, yemen), (244, yugoslavia), (245, zambia), (246, zimbabwe))

at D:\Business\Other\dasundev-backend\vendor\laravel\framework\src\Illuminate\Database\Connection.php:678 674▕ // If an exception occurs when attempting to run a query, we'll format the error 675▕ // message to include the bindings with SQL, which will make this exception a 676▕ // lot more helpful to the developer instead of just the database's errors. 677▕ catch (Exception $e) { ➜ 678▕ throw new QueryException( 679▕ $query, $this->prepareBindings($bindings), $e 680▕ ); 681▕ } 682▕

1 D:\Business\Other\dasundev-backend\vendor\laravel\framework\src\Illuminate\Database\Connection.php:471 PDOException::("SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'")

2 D:\Business\Other\dasundev-backend\vendor\laravel\framework\src\Illuminate\Database\Connection.php:471 PDOStatement::execute()

dipeshsukhia commented 3 years ago

please follow below steps you will not get errors run below commands 1) php artisan vendor:publish --tag=LaravelCountryStateCityData 2) composer dump-autoload 3) php artisan migrate

dasundev commented 3 years ago

This solution is not working. Anyway I'll check this by myself then will open PR 😊🤝