Skip to content

Migrations

When you install Laravel Countries, the following database migrations will be executed to create the necessary table structure for storing countries, regions, geographical data, and translations.

Here is an overview of the migrations: Below is a breakdown of each column and its purpose:

Countries Table

Column NameDescription
idThe primary key for the table. (integer, auto-increment)
lc_region_idThe foreign key linking to the lc_regions table. (tinyInteger, unsigned)
uidA unique identifier for the country record. (ulid, unique)
official_nameThe official name of the country. (string)
capitalThe name of the country's capital. (string)
iso_alpha_2The two-letter ISO 3166-1 alpha-2 country code. (string, length: 10)
iso_alpha_3The three-letter ISO 3166-1 alpha-3 country code. (string, length: 10)
iso_numericThe ISO 3166-1 numeric country code. (smallInteger, nullable)
international_phoneThe international dialing code for the country. (string, nullable, length: 150)
geoname_idThe ID linking to the GeoNames geographical database. (string, nullable, length: 10)
wmoCountry abbreviations by the World Meteorological Organization (WMO). (string, nullable)
independence_dayThe year the country gained independence. (year, nullable)
populationThe population of the country. (smallInteger, nullable)
areaThe total area of the country in square kilometers. (smallInteger, nullable)
gdpThe gross domestic product (GDP) of the country in billions of USD. (string, nullable)
languagesA list of languages spoken in the country in JSON format. (json, default: [])
tldThe top-level domains (TLDs) associated with the country. (json, default: [])
alternative_tldAlternative top-level domains (TLDs) associated with the country. (json, default: [])
bordersA list of countries that share a border with this country. (json, default: [])
timezonesThe timezones associated with the country. (json, default: {main: [], others: []})
currencyDetailed currency information including name, code, symbol, unit, banknotes, and coins. (json, default: {...})
flag_emojiThe emoji representation of the country's flag. (json, default: [])
flag_colorsThe colors that make up the country's flag. (json, default: [])
flag_colors_webThe web-safe colors used for the country's flag. (json, default: [])
flag_colors_contrastContrast colors to ensure text legibility on top of the flag's colors. (json, default: [])
flag_colors_hexThe hexadecimal color codes of the flag. (json, default: [])
flag_colors_rgbThe RGB values of the flag's colors. (json, default: [])
flag_colors_cmykThe CMYK values of the flag's colors. (json, default: [])
flag_colors_hslThe HSL values of the flag's colors. (json, default: [])
flag_colors_hsvThe HSV values of the flag's colors. (json, default: [])
flag_colors_pantoneThe Pantone color codes of the flag. (json, default: [])
visibleIndicates whether the country is visible in the system. (boolean, default: true)
timestampsAuto-generated timestamps for when the record is created or updated. (created_at, updated_at)
uniqueEnsures uniqueness based on the region and ISO Alpha-2 code. ((lc_region_id, iso_alpha_2))
foreign keyLinks to the lc_regions table, with cascading deletes. ((lc_region_id))

Regions Table

Column NameDescription
idThe primary key of the table, automatically incremented. (tinyIncrements)
iso_alpha_2ISO 3166-1 Alpha-2 code. (string, length: 10)
icaoInternational Civil Aviation Organization (ICAO) region. (string, length: 10)
iucnInternational Union for Conservation of Nature (IUCN) region. (string, length: 10)
tdwgWorld Geographical Scheme for Recording Plant Distributions code. (string, length: 10)
is_visibleVisibility status, defaulting to true. (boolean, default: true)

Coordinates Table

Column NameDescription
idThe primary key of the table, automatically incremented. (increments)
lc_country_idThe foreign key linking to the lc_countries table. (integer, unsigned)
latitudeThe latitude coordinate. (string, nullable)
longitudeThe longitude coordinate. (string, nullable)
degrees_with_decimalCoordinates in degrees with decimal format. (string, nullable)
degrees_minutes_secondsCoordinates in degrees, minutes, and seconds format. (string, nullable)
degrees_and_decimal_minutesCoordinates in degrees and decimal minutes format. (string, nullable)
gpsGPS data in JSON format. (json, nullable)

Geographical Table

Column NameDescription
idThe primary key of the table, automatically incremented. (increments)
lc_country_idThe foreign key linking to the lc_countries table. (integer, unsigned)
typeThe type of the geographical data. (string)
features_typeThe feature type of the geographical data. (string)
propertiesAdditional properties stored in JSON format. (json)
geometryGeometrical data stored in JSON format. (json)

Extras Table

Column NameDescription
idPrimary key: auto-incremented extra information ID. (increments)
lc_country_idForeign key linking to the lc_countries table. (integer, unsigned)
national_sportThe national sport of the country, if applicable. (string, nullable)
cybersecurity_agencyName of the country's national cybersecurity agency. (string, nullable)
popular_technologiesA list of popular technologies used in the country (e.g., programming languages, platforms). (json, nullable)
internetInformation about the country's internet infrastructure, including speed and penetration. (json, nullable)
religionsA list of religions practiced in the country. (json, nullable)
international_organizationsA list of international organizations the country is a member of (e.g., UN, WTO). (json, nullable)

Released under the MIT License.