Skip to content

[Bug]: Correction of Spanish states data structure in the database #1179

@StefanTudor

Description

@StefanTudor

Bug Type

Incorrect Data (wrong city/state/country information)

Affected Entity

Spain

Bug Description

In the database, there are entries for both provinces and autonomous communities under Spain. However, this is incorrect — autonomous communities are an administrative level above provinces and include them. Therefore, they should not exist as separate state-level entities in our database.

For example, we currently have two entries for Cantabria:

{
"id": 1170,
"name": "Cantabria",
"country_id": 207,
"country_code": "ES",
"country_name": "Spain",
"iso2": "S",
"iso3166_2": "ES-S",
"fips_code": "39",
"type": "province",
"level": "1",
"parent_id": "1170",
"native": "Furtivo",
"latitude": "43.15956640",
"longitude": "-4.08783820",
"timezone": "Europe/Madrid"
}

and

{
"id": 5328,
"name": "Cantabria",
"country_id": 207,
"country_code": "ES",
"country_name": "Spain",
"iso2": "CB",
"iso3166_2": "ES-CB",
"fips_code": "",
"type": "autonomous community",
"level": null,
"parent_id": null,
"native": "Furtivo",
"latitude": "43.15956640",
"longitude": "-4.08783820",
"timezone": "Europe/Madrid"
}

Expected Behavior

The second record (and al the the autonomous communities) should be removed, since only provinces should exist as states in Spain and the second one doesn't have any cities related to.

Actual Behavior

There are both autonomous community with the same name.

Source/Reference

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions