1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-05 05:05:17 +02:00

Refactor data insertion via Drizzle

This commit is contained in:
Sean Morley 2024-04-26 22:43:13 +00:00
parent 37f050d254
commit 319a99fed2
25 changed files with 1511 additions and 661 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE "adventures" ALTER COLUMN "userId" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "adventures" ADD COLUMN "type" text NOT NULL;

View file

@ -0,0 +1,565 @@
{
"id": "f9d623fb-6563-4b3f-b4c2-6f2169f95e3b",
"prevId": "d1a58675-3daf-43e2-a9a1-c56767fc3d0e",
"version": "5",
"dialect": "pg",
"tables": {
"adventures": {
"name": "adventures",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"userId": {
"name": "userId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": false
},
"activityTypes": {
"name": "activityTypes",
"type": "json",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"rating": {
"name": "rating",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"link": {
"name": "link",
"type": "text",
"primaryKey": false,
"notNull": false
},
"imageUrl": {
"name": "imageUrl",
"type": "text",
"primaryKey": false,
"notNull": false
},
"date": {
"name": "date",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"adventures_userId_user_id_fk": {
"name": "adventures_userId_user_id_fk",
"tableFrom": "adventures",
"tableTo": "user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"featuredAdventures": {
"name": "featuredAdventures",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"featuredAdventures_name_unique": {
"name": "featuredAdventures_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
}
},
"session": {
"name": "session",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"session_user_id_user_id_fk": {
"name": "session_user_id_user_id_fk",
"tableFrom": "session",
"tableTo": "user",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"sharedAdventures": {
"name": "sharedAdventures",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"data": {
"name": "data",
"type": "json",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"date": {
"name": "date",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"userPlannedAdventures": {
"name": "userPlannedAdventures",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"userId": {
"name": "userId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"adventureName": {
"name": "adventureName",
"type": "text",
"primaryKey": false,
"notNull": true
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": false
},
"activityTypes": {
"name": "activityTypes",
"type": "json",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"plannedDate": {
"name": "plannedDate",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"userPlannedAdventures_userId_user_id_fk": {
"name": "userPlannedAdventures_userId_user_id_fk",
"tableFrom": "userPlannedAdventures",
"tableTo": "user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"user": {
"name": "user",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"username": {
"name": "username",
"type": "text",
"primaryKey": false,
"notNull": true
},
"first_name": {
"name": "first_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"last_name": {
"name": "last_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": false
},
"hashed_password": {
"name": "hashed_password",
"type": "varchar",
"primaryKey": false,
"notNull": true
},
"signup_date": {
"name": "signup_date",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"last_login": {
"name": "last_login",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"userVisitedAdventures": {
"name": "userVisitedAdventures",
"schema": "",
"columns": {
"adventure_id": {
"name": "adventure_id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"adventure_name": {
"name": "adventure_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": false
},
"visited_date": {
"name": "visited_date",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"userVisitedAdventures_user_id_user_id_fk": {
"name": "userVisitedAdventures_user_id_user_id_fk",
"tableFrom": "userVisitedAdventures",
"tableTo": "user",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"userVisitedWorldTravel": {
"name": "userVisitedWorldTravel",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"country_code": {
"name": "country_code",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"region_id": {
"name": "region_id",
"type": "varchar",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"userVisitedWorldTravel_country_code_worldTravelCountries_country_code_fk": {
"name": "userVisitedWorldTravel_country_code_worldTravelCountries_country_code_fk",
"tableFrom": "userVisitedWorldTravel",
"tableTo": "worldTravelCountries",
"columnsFrom": [
"country_code"
],
"columnsTo": [
"country_code"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"userVisitedWorldTravel_user_id_user_id_fk": {
"name": "userVisitedWorldTravel_user_id_user_id_fk",
"tableFrom": "userVisitedWorldTravel",
"tableTo": "user",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"userVisitedWorldTravel_region_id_worldTravelCountryRegions_id_fk": {
"name": "userVisitedWorldTravel_region_id_worldTravelCountryRegions_id_fk",
"tableFrom": "userVisitedWorldTravel",
"tableTo": "worldTravelCountryRegions",
"columnsFrom": [
"region_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"worldTravelCountries": {
"name": "worldTravelCountries",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"country_code": {
"name": "country_code",
"type": "text",
"primaryKey": false,
"notNull": true
},
"continent": {
"name": "continent",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"worldTravelCountries_country_code_unique": {
"name": "worldTravelCountries_country_code_unique",
"nullsNotDistinct": false,
"columns": [
"country_code"
]
}
}
},
"worldTravelCountryRegions": {
"name": "worldTravelCountryRegions",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "varchar",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"country_code": {
"name": "country_code",
"type": "text",
"primaryKey": false,
"notNull": true
},
"info": {
"name": "info",
"type": "json",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"worldTravelCountryRegions_country_code_worldTravelCountries_country_code_fk": {
"name": "worldTravelCountryRegions_country_code_worldTravelCountries_country_code_fk",
"tableFrom": "worldTravelCountryRegions",
"tableTo": "worldTravelCountries",
"columnsFrom": [
"country_code"
],
"columnsTo": [
"country_code"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
"schemas": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}

View file

@ -85,6 +85,13 @@
"when": 1713746739294,
"tag": "0011_bizarre_silver_samurai",
"breakpoints": true
},
{
"idx": 12,
"version": "5",
"when": 1714169595867,
"tag": "0012_quiet_katie_power",
"breakpoints": true
}
]
}

View file

@ -1,18 +1,18 @@
INSERT INTO "worldTravelCountries" (name, country_code, continent)
VALUES
('United States', 'us', 'North America'),
('Canada', 'ca', 'North America'),
('Mexico', 'mx', 'North America'),
('Brazil', 'br', 'South America'),
('Argentina', 'ar', 'South America'),
('United Kingdom', 'gb', 'Europe'),
('Germany', 'de', 'Europe'),
('France', 'fr', 'Europe'),
('Japan', 'jp', 'Asia'),
('China', 'cn', 'Asia'),
('India', 'in', 'Asia'),
('Australia', 'au', 'Oceania'),
('New Zealand', 'nz', 'Oceania'),
('South Africa', 'za', 'Africa'),
('Egypt', 'eg', 'Africa')
ON CONFLICT (country_code) DO NOTHING;
-- INSERT INTO "worldTravelCountries" (name, country_code, continent)
-- VALUES
-- ('United States', 'us', 'North America'),
-- ('Canada', 'ca', 'North America'),
-- ('Mexico', 'mx', 'North America'),
-- ('Brazil', 'br', 'South America'),
-- ('Argentina', 'ar', 'South America'),
-- ('United Kingdom', 'gb', 'Europe'),
-- ('Germany', 'de', 'Europe'),
-- ('France', 'fr', 'Europe'),
-- ('Japan', 'jp', 'Asia'),
-- ('China', 'cn', 'Asia'),
-- ('India', 'in', 'Asia'),
-- ('Australia', 'au', 'Oceania'),
-- ('New Zealand', 'nz', 'Oceania'),
-- ('South Africa', 'za', 'Africa'),
-- ('Egypt', 'eg', 'Africa')
-- ON CONFLICT (country_code) DO NOTHING;

View file

@ -1,270 +1,52 @@
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('US-AL', 'Alabama', 'us', '{
-- "name": "Alabama",
-- "abbreviation": "AL",
-- "description": "Alabama is a state located in the southeastern region of the United States. Known for its rich history, including its role in the American Civil War and the Civil Rights Movement, Alabama offers a diverse landscape of mountains, plains, and coastal areas. The state boasts a humid subtropical climate and is known for its strong tradition in college sports, particularly football. Alabama''s economy is diverse, with major industries including automotive manufacturing, agriculture, and aerospace. Tourists are drawn to Alabama''s natural beauty, historical sites, and cultural landmarks.",
-- "capital": "Montgomery",
-- "largest_city": "Birmingham",
-- "area": {
-- "total": 52420,
-- "units": "square miles"
-- },
-- "population": {
-- "estimate": 4903185,
-- "year": 2020
-- },
-- "state_flower": "Camellia",
-- "state_bird": "Yellowhammer",
-- "state_tree": "Southern Longleaf Pine",
-- "climate": {
-- "description": "Humid subtropical",
-- "summer_highs": "80-90°F",
-- "winter_lows": "30-50°F",
-- "precipitation": "Abundant throughout the year"
-- },
-- "economy": {
-- "industries": [
-- "Automotive Manufacturing",
-- "Agriculture",
-- "Mining",
-- "Technology",
-- "Aerospace"
-- ],
-- "agricultural_products": [
-- "Poultry",
-- "Cotton",
-- "Peanuts",
-- "Soybeans",
-- "Corn"
-- ]
-- },
-- "tourism": {
-- "attractions": [
-- "U.S. Space & Rocket Center",
-- "Gulf Shores and Orange Beach",
-- "Rosa Parks Museum",
-- "Civil Rights Institute",
-- "Little River Canyon National Preserve"
-- ]
-- },
-- "major_sports_teams": [
-- "Alabama Crimson Tide (NCAA)",
-- "Auburn Tigers (NCAA)"
-- ]
-- }'),
-- ('US-AK', 'Alaska', 'us', '{
-- "name": "Alaska",
-- "abbreviation": "AK",
-- "description": "Alaska is the largest state in the United States by area, known for its rugged and breathtaking natural beauty. It is situated in the northwesternmost region of North America and is bordered by Canada to the east, the Arctic Ocean to the north, and the Pacific Ocean to the west and south. Alaska is renowned for its diverse wildlife, glaciers, and majestic mountains. The state is sparsely populated, with the majority of its residents living in and around Anchorage and Fairbanks. Alaska''s economy is heavily dependent on oil and gas production, as well as fishing, tourism, and mining.",
-- "capital": "Juneau",
-- "largest_city": "Anchorage",
-- "area": {
-- "total": 663267,
-- "units": "square miles"
-- },
-- "population": {
-- "estimate": 731158,
-- "year": 2020
-- },
-- "state_flower": "Forget-Me-Not",
-- "state_bird": "Willow Ptarmigan",
-- "state_tree": "Sitka Spruce",
-- "climate": {
-- "description": "Varies by region, with subarctic and arctic climates in the interior and north and more temperate maritime climates along the coast.",
-- "summer_highs": "50-70°F (varies by region)",
-- "winter_lows": "-40 to 20°F (varies by region)",
-- "precipitation": "Ranges from low in the interior to high along the coast"
-- },
-- "economy": {
-- "industries": [
-- "Oil and Gas",
-- "Fishing",
-- "Mining",
-- "Tourism",
-- "Forestry"
-- ],
-- "agricultural_products": [
-- "Cattle",
-- "Hay",
-- "Vegetables",
-- "Barley",
-- "Dairy products"
-- ]
-- },
-- "tourism": {
-- "attractions": [
-- "Denali National Park",
-- "Glacier Bay National Park",
-- "Kenai Fjords National Park",
-- "Sitka National Historical Park",
-- "Anchorage Museum"
-- ]
-- },
-- "major_sports_teams": [
-- "Anchorage Wolverines (NAHL)",
-- "Alaska Aces (ECHL, formerly)"
-- ]
-- }
-- '),
-- ('US-AZ', 'Arizona', 'us', '{
-- "name": "Arizona",
-- "abbreviation": "AZ",
-- "description": "Arizona is a state located in the southwestern region of the United States, known for its dramatic desert landscapes and vibrant history. The state is home to iconic landmarks such as the Grand Canyon and Monument Valley. Arizona''s diverse geography includes mountain ranges, forests, and high plateaus. The state has a warm desert climate in the southern and central areas and cooler mountain climates in the northern region. Arizona''s economy is driven by industries such as healthcare, technology, manufacturing, and tourism.",
-- "capital": "Phoenix",
-- "largest_city": "Phoenix",
-- "area": {
-- "total": 113990,
-- "units": "square miles"
-- },
-- "population": {
-- "estimate": 7151502,
-- "year": 2020
-- },
-- "state_flower": "Saguaro Cactus Blossom",
-- "state_bird": "Cactus Wren",
-- "state_tree": "Palo Verde",
-- "climate": {
-- "description": "Mostly arid and semi-arid, with desert climates in the southern and central regions and temperate climates in the north.",
-- "summer_highs": "85-120°F (varies by region)",
-- "winter_lows": "30-60°F (varies by region)",
-- "precipitation": "Low in most areas, with higher amounts in mountain regions"
-- },
-- "economy": {
-- "industries": [
-- "Healthcare",
-- "Technology",
-- "Manufacturing",
-- "Tourism",
-- "Agriculture"
-- ],
-- "agricultural_products": [
-- "Cattle",
-- "Dairy",
-- "Lettuce",
-- "Cotton",
-- "Alfalfa"
-- ]
-- },
-- "tourism": {
-- "attractions": [
-- "Grand Canyon National Park",
-- "Sedona",
-- "Monument Valley",
-- "Saguaro National Park",
-- "Petrified Forest National Park"
-- ]
-- },
-- "major_sports_teams": [
-- "Arizona Cardinals (NFL)",
-- "Phoenix Suns (NBA)",
-- "Arizona Diamondbacks (MLB)",
-- "Arizona Coyotes (NHL)"
-- ]
-- }
-- '),
-- ('US-AR', 'Arkansas', 'us', '{
-- "name": "Arkansas",
-- "abbreviation": "AR",
-- "description": "Arkansas is a state located in the southeastern region of the United States, known for its natural beauty and diverse landscapes that include mountains, forests, and rivers. The state is nicknamed ''The Natural State'' due to its abundant natural resources and outdoor recreational opportunities. Arkansas has a rich history and played a significant role during the American Civil War. The state''s economy is driven by agriculture, manufacturing, and tourism, with key agricultural products including rice, poultry, and soybeans.",
-- "capital": "Little Rock",
-- "largest_city": "Little Rock",
-- "area": {
-- "total": 53179,
-- "units": "square miles"
-- },
-- "population": {
-- "estimate": 3013756,
-- "year": 2020
-- },
-- "state_flower": "Apple Blossom",
-- "state_bird": "Northern Mockingbird",
-- "state_tree": "Pine",
-- "climate": {
-- "description": "Humid subtropical climate, with hot summers and mild winters.",
-- "summer_highs": "80-90°F",
-- "winter_lows": "20-40°F",
-- "precipitation": "High, especially in the spring"
-- },
-- "economy": {
-- "industries": [
-- "Agriculture",
-- "Manufacturing",
-- "Retail",
-- "Tourism",
-- "Education"
-- ],
-- "agricultural_products": [
-- "Rice",
-- "Poultry",
-- "Soybeans",
-- "Cotton",
-- "Catfish"
-- ]
-- },
-- "tourism": {
-- "attractions": [
-- "Hot Springs National Park",
-- "Buffalo National River",
-- "Crater of Diamonds State Park",
-- "Little Rock Central High School National Historic Site",
-- "Ozark National Forest"
-- ]
-- },
-- "major_sports_teams": [
-- "Arkansas Razorbacks (NCAA)"
-- ]
-- }
-- '),
INSERT INTO "worldTravelCountryRegions" (id, name, country_code) VALUES
('US-AL', 'Alabama', 'us'),
('US-AK', 'Alaska', 'us'),
('US-AZ', 'Arizona', 'us'),
('US-AR', 'Arkansas', 'us'),
('US-CA', 'California', 'us'),
('US-CO', 'Colorado', 'us'),
('US-CT', 'Connecticut', 'us'),
('US-DE', 'Delaware', 'us'),
('US-FL', 'Florida', 'us'),
('US-GA', 'Georgia', 'us'),
('US-HI', 'Hawaii', 'us'),
('US-ID', 'Idaho', 'us'),
('US-IL', 'Illinois', 'us'),
('US-IN', 'Indiana', 'us'),
('US-IA', 'Iowa', 'us'),
('US-KS', 'Kansas', 'us'),
('US-KY', 'Kentucky', 'us'),
('US-LA', 'Louisiana', 'us'),
('US-ME', 'Maine', 'us'),
('US-MD', 'Maryland', 'us'),
('US-MA', 'Massachusetts', 'us'),
('US-MI', 'Michigan', 'us'),
('US-MN', 'Minnesota', 'us'),
('US-MS', 'Mississippi', 'us'),
('US-MO', 'Missouri', 'us'),
('US-MT', 'Montana', 'us'),
('US-NE', 'Nebraska', 'us'),
('US-NV', 'Nevada', 'us'),
('US-NH', 'New Hampshire', 'us'),
('US-NJ', 'New Jersey', 'us'),
('US-NM', 'New Mexico', 'us'),
('US-NY', 'New York', 'us'),
('US-NC', 'North Carolina', 'us'),
('US-ND', 'North Dakota', 'us'),
('US-OH', 'Ohio', 'us'),
('US-OK', 'Oklahoma', 'us'),
('US-OR', 'Oregon', 'us'),
('US-PA', 'Pennsylvania', 'us'),
('US-RI', 'Rhode Island', 'us'),
('US-SC', 'South Carolina', 'us'),
('US-SD', 'South Dakota', 'us'),
('US-TN', 'Tennessee', 'us'),
('US-TX', 'Texas', 'us'),
('US-UT', 'Utah', 'us'),
('US-VT', 'Vermont', 'us'),
('US-VA', 'Virginia', 'us'),
('US-WA', 'Washington', 'us'),
('US-WV', 'West Virginia', 'us'),
('US-WI', 'Wisconsin', 'us'),
('US-WY', 'Wyoming', 'us')
ON CONFLICT (id) DO NOTHING;
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code) VALUES
-- ('US-AL', 'Alabama', 'us'),
-- ('US-AK', 'Alaska', 'us'),
-- ('US-AZ', 'Arizona', 'us'),
-- ('US-AR', 'Arkansas', 'us'),
-- ('US-CA', 'California', 'us'),
-- ('US-CO', 'Colorado', 'us'),
-- ('US-CT', 'Connecticut', 'us'),
-- ('US-DE', 'Delaware', 'us'),
-- ('US-FL', 'Florida', 'us'),
-- ('US-GA', 'Georgia', 'us'),
-- ('US-HI', 'Hawaii', 'us'),
-- ('US-ID', 'Idaho', 'us'),
-- ('US-IL', 'Illinois', 'us'),
-- ('US-IN', 'Indiana', 'us'),
-- ('US-IA', 'Iowa', 'us'),
-- ('US-KS', 'Kansas', 'us'),
-- ('US-KY', 'Kentucky', 'us'),
-- ('US-LA', 'Louisiana', 'us'),
-- ('US-ME', 'Maine', 'us'),
-- ('US-MD', 'Maryland', 'us'),
-- ('US-MA', 'Massachusetts', 'us'),
-- ('US-MI', 'Michigan', 'us'),
-- ('US-MN', 'Minnesota', 'us'),
-- ('US-MS', 'Mississippi', 'us'),
-- ('US-MO', 'Missouri', 'us'),
-- ('US-MT', 'Montana', 'us'),
-- ('US-NE', 'Nebraska', 'us'),
-- ('US-NV', 'Nevada', 'us'),
-- ('US-NH', 'New Hampshire', 'us'),
-- ('US-NJ', 'New Jersey', 'us'),
-- ('US-NM', 'New Mexico', 'us'),
-- ('US-NY', 'New York', 'us'),
-- ('US-NC', 'North Carolina', 'us'),
-- ('US-ND', 'North Dakota', 'us'),
-- ('US-OH', 'Ohio', 'us'),
-- ('US-OK', 'Oklahoma', 'us'),
-- ('US-OR', 'Oregon', 'us'),
-- ('US-PA', 'Pennsylvania', 'us'),
-- ('US-RI', 'Rhode Island', 'us'),
-- ('US-SC', 'South Carolina', 'us'),
-- ('US-SD', 'South Dakota', 'us'),
-- ('US-TN', 'Tennessee', 'us'),
-- ('US-TX', 'Texas', 'us'),
-- ('US-UT', 'Utah', 'us'),
-- ('US-VT', 'Vermont', 'us'),
-- ('US-VA', 'Virginia', 'us'),
-- ('US-WA', 'Washington', 'us'),
-- ('US-WV', 'West Virginia', 'us'),
-- ('US-WI', 'Wisconsin', 'us'),
-- ('US-WY', 'Wyoming', 'us')
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,16 +1,16 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('CA-AB', 'Alberta', 'ca'),
('CA-BC', 'British Columbia', 'ca'),
('CA-MB', 'Manitoba', 'ca'),
('CA-NB', 'New Brunswick', 'ca'),
('CA-NL', 'Newfoundland and Labrador', 'ca'),
('CA-NS', 'Nova Scotia', 'ca'),
('CA-ON', 'Ontario', 'ca'),
('CA-PE', 'Prince Edward Island', 'ca'),
('CA-QC', 'Quebec', 'ca'),
('CA-SK', 'Saskatchewan', 'ca'),
('CA-NT', 'Northwest Territories', 'ca'),
('CA-NU', 'Nunavut', 'ca'),
('CA-YT', 'Yukon', 'ca')
ON CONFLICT (id) DO NOTHING;
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('CA-AB', 'Alberta', 'ca'),
-- ('CA-BC', 'British Columbia', 'ca'),
-- ('CA-MB', 'Manitoba', 'ca'),
-- ('CA-NB', 'New Brunswick', 'ca'),
-- ('CA-NL', 'Newfoundland and Labrador', 'ca'),
-- ('CA-NS', 'Nova Scotia', 'ca'),
-- ('CA-ON', 'Ontario', 'ca'),
-- ('CA-PE', 'Prince Edward Island', 'ca'),
-- ('CA-QC', 'Quebec', 'ca'),
-- ('CA-SK', 'Saskatchewan', 'ca'),
-- ('CA-NT', 'Northwest Territories', 'ca'),
-- ('CA-NU', 'Nunavut', 'ca'),
-- ('CA-YT', 'Yukon', 'ca')
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,20 +1,20 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('DE-BW', 'Baden-Württemberg', 'de'),
('DE-BY', 'Bavaria', 'de'),
('DE-BE', 'Berlin', 'de'),
('DE-BB', 'Brandenburg', 'de'),
('DE-HB', 'Bremen', 'de'),
('DE-HH', 'Hamburg', 'de'),
('DE-HE', 'Hesse', 'de'),
('DE-NI', 'Lower Saxony', 'de'),
('DE-MV', 'Mecklenburg-Vorpommern', 'de'),
('DE-NW', 'North Rhine-Westphalia', 'de'),
('DE-RP', 'Rhineland-Palatinate', 'de'),
('DE-SL', 'Saarland', 'de'),
('DE-SN', 'Saxony', 'de'),
('DE-ST', 'Saxony-Anhalt', 'de'),
('DE-SH', 'Schleswig-Holstein', 'de'),
('DE-TH', 'Thuringia', 'de')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('DE-BW', 'Baden-Württemberg', 'de'),
-- ('DE-BY', 'Bavaria', 'de'),
-- ('DE-BE', 'Berlin', 'de'),
-- ('DE-BB', 'Brandenburg', 'de'),
-- ('DE-HB', 'Bremen', 'de'),
-- ('DE-HH', 'Hamburg', 'de'),
-- ('DE-HE', 'Hesse', 'de'),
-- ('DE-NI', 'Lower Saxony', 'de'),
-- ('DE-MV', 'Mecklenburg-Vorpommern', 'de'),
-- ('DE-NW', 'North Rhine-Westphalia', 'de'),
-- ('DE-RP', 'Rhineland-Palatinate', 'de'),
-- ('DE-SL', 'Saarland', 'de'),
-- ('DE-SN', 'Saxony', 'de'),
-- ('DE-ST', 'Saxony-Anhalt', 'de'),
-- ('DE-SH', 'Schleswig-Holstein', 'de'),
-- ('DE-TH', 'Thuringia', 'de')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,22 +1,22 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('FR-ARA', 'Auvergne-Rhône-Alpes', 'fr'),
('FR-BFC', 'Bourgogne-Franche-Comté', 'fr'),
('FR-BRE', 'Brittany', 'fr'),
('FR-CVL', 'Centre-Val de Loire', 'fr'),
('FR-GES', 'Grand Est', 'fr'),
('FR-HDF', 'Hauts-de-France', 'fr'),
('FR-IDF', 'Île-de-France', 'fr'),
('FR-NOR', 'Normandy', 'fr'),
('FR-NAQ', 'Nouvelle-Aquitaine', 'fr'),
('FR-OCC', 'Occitanie', 'fr'),
('FR-PDL', 'Pays de la Loire', 'fr'),
('FR-PAC', 'Provence-Alpes-Côte d''Azur', 'fr'),
('FR-COR', 'Corsica', 'fr'),
('FR-MQ', 'Martinique', 'fr'),
('FR-GF', 'French Guiana', 'fr'),
('FR-RÉ', 'Réunion', 'fr'),
('FR-YT', 'Mayotte', 'fr'),
('FR-GP', 'Guadeloupe', 'fr')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('FR-ARA', 'Auvergne-Rhône-Alpes', 'fr'),
-- ('FR-BFC', 'Bourgogne-Franche-Comté', 'fr'),
-- ('FR-BRE', 'Brittany', 'fr'),
-- ('FR-CVL', 'Centre-Val de Loire', 'fr'),
-- ('FR-GES', 'Grand Est', 'fr'),
-- ('FR-HDF', 'Hauts-de-France', 'fr'),
-- ('FR-IDF', 'Île-de-France', 'fr'),
-- ('FR-NOR', 'Normandy', 'fr'),
-- ('FR-NAQ', 'Nouvelle-Aquitaine', 'fr'),
-- ('FR-OCC', 'Occitanie', 'fr'),
-- ('FR-PDL', 'Pays de la Loire', 'fr'),
-- ('FR-PAC', 'Provence-Alpes-Côte d''Azur', 'fr'),
-- ('FR-COR', 'Corsica', 'fr'),
-- ('FR-MQ', 'Martinique', 'fr'),
-- ('FR-GF', 'French Guiana', 'fr'),
-- ('FR-RÉ', 'Réunion', 'fr'),
-- ('FR-YT', 'Mayotte', 'fr'),
-- ('FR-GP', 'Guadeloupe', 'fr')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,8 +1,8 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('GB-ENG', 'England', 'gb'),
('GB-NIR', 'Northern Ireland', 'gb'),
('GB-SCT', 'Scotland', 'gb'),
('GB-WLS', 'Wales', 'gb')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('GB-ENG', 'England', 'gb'),
-- ('GB-NIR', 'Northern Ireland', 'gb'),
-- ('GB-SCT', 'Scotland', 'gb'),
-- ('GB-WLS', 'Wales', 'gb')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,28 +1,28 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('AR-C', 'Ciudad Autónoma de Buenos Aires', 'ar'),
('AR-B', 'Buenos Aires', 'ar'),
('AR-K', 'Catamarca', 'ar'),
('AR-H', 'Chaco', 'ar'),
('AR-U', 'Chubut', 'ar'),
('AR-W', 'Córdoba', 'ar'),
('AR-X', 'Corrientes', 'ar'),
('AR-E', 'Entre Ríos', 'ar'),
('AR-P', 'Formosa', 'ar'),
('AR-Y', 'Jujuy', 'ar'),
('AR-L', 'La Pampa', 'ar'),
('AR-F', 'La Rioja', 'ar'),
('AR-M', 'Mendoza', 'ar'),
('AR-N', 'Misiones', 'ar'),
('AR-Q', 'Neuquén', 'ar'),
('AR-R', 'Río Negro', 'ar'),
('AR-A', 'Salta', 'ar'),
('AR-J', 'San Juan', 'ar'),
('AR-D', 'San Luis', 'ar'),
('AR-Z', 'Santa Cruz', 'ar'),
('AR-S', 'Santa Fe', 'ar'),
('AR-G', 'Santiago del Estero', 'ar'),
('AR-V', 'Tierra del Fuego', 'ar'),
('AR-T', 'Tucumán', 'ar')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('AR-C', 'Ciudad Autónoma de Buenos Aires', 'ar'),
-- ('AR-B', 'Buenos Aires', 'ar'),
-- ('AR-K', 'Catamarca', 'ar'),
-- ('AR-H', 'Chaco', 'ar'),
-- ('AR-U', 'Chubut', 'ar'),
-- ('AR-W', 'Córdoba', 'ar'),
-- ('AR-X', 'Corrientes', 'ar'),
-- ('AR-E', 'Entre Ríos', 'ar'),
-- ('AR-P', 'Formosa', 'ar'),
-- ('AR-Y', 'Jujuy', 'ar'),
-- ('AR-L', 'La Pampa', 'ar'),
-- ('AR-F', 'La Rioja', 'ar'),
-- ('AR-M', 'Mendoza', 'ar'),
-- ('AR-N', 'Misiones', 'ar'),
-- ('AR-Q', 'Neuquén', 'ar'),
-- ('AR-R', 'Río Negro', 'ar'),
-- ('AR-A', 'Salta', 'ar'),
-- ('AR-J', 'San Juan', 'ar'),
-- ('AR-D', 'San Luis', 'ar'),
-- ('AR-Z', 'Santa Cruz', 'ar'),
-- ('AR-S', 'Santa Fe', 'ar'),
-- ('AR-G', 'Santiago del Estero', 'ar'),
-- ('AR-V', 'Tierra del Fuego', 'ar'),
-- ('AR-T', 'Tucumán', 'ar')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,35 +1,35 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('MX-AGU', 'Aguascalientes', 'mx'),
('MX-BCN', 'Baja California', 'mx'),
('MX-BCS', 'Baja California Sur', 'mx'),
('MX-CAM', 'Campeche', 'mx'),
('MX-CHP', 'Chiapas', 'mx'),
('MX-CHH', 'Chihuahua', 'mx'),
('MX-COA', 'Coahuila', 'mx'),
('MX-COL', 'Colima', 'mx'),
('MX-DUR', 'Durango', 'mx'),
('MX-GUA', 'Guanajuato', 'mx'),
('MX-GRO', 'Guerrero', 'mx'),
('MX-HID', 'Hidalgo', 'mx'),
('MX-JAL', 'Jalisco', 'mx'),
('MX-MEX', 'State of Mexico', 'mx'),
('MX-MIC', 'Michoacán', 'mx'),
('MX-MOR', 'Morelos', 'mx'),
('MX-NAY', 'Nayarit', 'mx'),
('MX-NLE', 'Nuevo León', 'mx'),
('MX-OAX', 'Oaxaca', 'mx'),
('MX-PUE', 'Puebla', 'mx'),
('MX-QUE', 'Querétaro', 'mx'),
('MX-ROO', 'Quintana Roo', 'mx'),
('MX-SLP', 'San Luis Potosí', 'mx'),
('MX-SIN', 'Sinaloa', 'mx'),
('MX-SON', 'Sonora', 'mx'),
('MX-TAB', 'Tabasco', 'mx'),
('MX-TAM', 'Tamaulipas', 'mx'),
('MX-TLA', 'Tlaxcala', 'mx'),
('MX-VER', 'Veracruz', 'mx'),
('MX-YUC', 'Yucatán', 'mx'),
('MX-ZAC', 'Zacatecas', 'mx')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('MX-AGU', 'Aguascalientes', 'mx'),
-- ('MX-BCN', 'Baja California', 'mx'),
-- ('MX-BCS', 'Baja California Sur', 'mx'),
-- ('MX-CAM', 'Campeche', 'mx'),
-- ('MX-CHP', 'Chiapas', 'mx'),
-- ('MX-CHH', 'Chihuahua', 'mx'),
-- ('MX-COA', 'Coahuila', 'mx'),
-- ('MX-COL', 'Colima', 'mx'),
-- ('MX-DUR', 'Durango', 'mx'),
-- ('MX-GUA', 'Guanajuato', 'mx'),
-- ('MX-GRO', 'Guerrero', 'mx'),
-- ('MX-HID', 'Hidalgo', 'mx'),
-- ('MX-JAL', 'Jalisco', 'mx'),
-- ('MX-MEX', 'State of Mexico', 'mx'),
-- ('MX-MIC', 'Michoacán', 'mx'),
-- ('MX-MOR', 'Morelos', 'mx'),
-- ('MX-NAY', 'Nayarit', 'mx'),
-- ('MX-NLE', 'Nuevo León', 'mx'),
-- ('MX-OAX', 'Oaxaca', 'mx'),
-- ('MX-PUE', 'Puebla', 'mx'),
-- ('MX-QUE', 'Querétaro', 'mx'),
-- ('MX-ROO', 'Quintana Roo', 'mx'),
-- ('MX-SLP', 'San Luis Potosí', 'mx'),
-- ('MX-SIN', 'Sinaloa', 'mx'),
-- ('MX-SON', 'Sonora', 'mx'),
-- ('MX-TAB', 'Tabasco', 'mx'),
-- ('MX-TAM', 'Tamaulipas', 'mx'),
-- ('MX-TLA', 'Tlaxcala', 'mx'),
-- ('MX-VER', 'Veracruz', 'mx'),
-- ('MX-YUC', 'Yucatán', 'mx'),
-- ('MX-ZAC', 'Zacatecas', 'mx')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,51 +1,51 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('JP-01', 'Hokkaido', 'jp'),
('JP-02', 'Aomori', 'jp'),
('JP-03', 'Iwate', 'jp'),
('JP-04', 'Miyagi', 'jp'),
('JP-05', 'Akita', 'jp'),
('JP-06', 'Yamagata', 'jp'),
('JP-07', 'Fukushima', 'jp'),
('JP-08', 'Ibaraki', 'jp'),
('JP-09', 'Tochigi', 'jp'),
('JP-10', 'Gunma', 'jp'),
('JP-11', 'Saitama', 'jp'),
('JP-12', 'Chiba', 'jp'),
('JP-13', 'Tokyo', 'jp'),
('JP-14', 'Kanagawa', 'jp'),
('JP-15', 'Niigata', 'jp'),
('JP-16', 'Toyama', 'jp'),
('JP-17', 'Ishikawa', 'jp'),
('JP-18', 'Fukui', 'jp'),
('JP-19', 'Yamanashi', 'jp'),
('JP-20', 'Nagano', 'jp'),
('JP-21', 'Gifu', 'jp'),
('JP-22', 'Shizuoka', 'jp'),
('JP-23', 'Aichi', 'jp'),
('JP-24', 'Mie', 'jp'),
('JP-25', 'Shiga', 'jp'),
('JP-26', 'Kyoto', 'jp'),
('JP-27', 'Osaka', 'jp'),
('JP-28', 'Hyogo', 'jp'),
('JP-29', 'Nara', 'jp'),
('JP-30', 'Wakayama', 'jp'),
('JP-31', 'Tottori', 'jp'),
('JP-32', 'Shimane', 'jp'),
('JP-33', 'Okayama', 'jp'),
('JP-34', 'Hiroshima', 'jp'),
('JP-35', 'Yamaguchi', 'jp'),
('JP-36', 'Tokushima', 'jp'),
('JP-37', 'Kagawa', 'jp'),
('JP-38', 'Ehime', 'jp'),
('JP-39', 'Kochi', 'jp'),
('JP-40', 'Fukuoka', 'jp'),
('JP-41', 'Saga', 'jp'),
('JP-42', 'Nagasaki', 'jp'),
('JP-43', 'Kumamoto', 'jp'),
('JP-44', 'Oita', 'jp'),
('JP-45', 'Miyazaki', 'jp'),
('JP-46', 'Kagoshima', 'jp'),
('JP-47', 'Okinawa', 'jp')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('JP-01', 'Hokkaido', 'jp'),
-- ('JP-02', 'Aomori', 'jp'),
-- ('JP-03', 'Iwate', 'jp'),
-- ('JP-04', 'Miyagi', 'jp'),
-- ('JP-05', 'Akita', 'jp'),
-- ('JP-06', 'Yamagata', 'jp'),
-- ('JP-07', 'Fukushima', 'jp'),
-- ('JP-08', 'Ibaraki', 'jp'),
-- ('JP-09', 'Tochigi', 'jp'),
-- ('JP-10', 'Gunma', 'jp'),
-- ('JP-11', 'Saitama', 'jp'),
-- ('JP-12', 'Chiba', 'jp'),
-- ('JP-13', 'Tokyo', 'jp'),
-- ('JP-14', 'Kanagawa', 'jp'),
-- ('JP-15', 'Niigata', 'jp'),
-- ('JP-16', 'Toyama', 'jp'),
-- ('JP-17', 'Ishikawa', 'jp'),
-- ('JP-18', 'Fukui', 'jp'),
-- ('JP-19', 'Yamanashi', 'jp'),
-- ('JP-20', 'Nagano', 'jp'),
-- ('JP-21', 'Gifu', 'jp'),
-- ('JP-22', 'Shizuoka', 'jp'),
-- ('JP-23', 'Aichi', 'jp'),
-- ('JP-24', 'Mie', 'jp'),
-- ('JP-25', 'Shiga', 'jp'),
-- ('JP-26', 'Kyoto', 'jp'),
-- ('JP-27', 'Osaka', 'jp'),
-- ('JP-28', 'Hyogo', 'jp'),
-- ('JP-29', 'Nara', 'jp'),
-- ('JP-30', 'Wakayama', 'jp'),
-- ('JP-31', 'Tottori', 'jp'),
-- ('JP-32', 'Shimane', 'jp'),
-- ('JP-33', 'Okayama', 'jp'),
-- ('JP-34', 'Hiroshima', 'jp'),
-- ('JP-35', 'Yamaguchi', 'jp'),
-- ('JP-36', 'Tokushima', 'jp'),
-- ('JP-37', 'Kagawa', 'jp'),
-- ('JP-38', 'Ehime', 'jp'),
-- ('JP-39', 'Kochi', 'jp'),
-- ('JP-40', 'Fukuoka', 'jp'),
-- ('JP-41', 'Saga', 'jp'),
-- ('JP-42', 'Nagasaki', 'jp'),
-- ('JP-43', 'Kumamoto', 'jp'),
-- ('JP-44', 'Oita', 'jp'),
-- ('JP-45', 'Miyazaki', 'jp'),
-- ('JP-46', 'Kagoshima', 'jp'),
-- ('JP-47', 'Okinawa', 'jp')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,35 +1,35 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('CN-BJ', 'Beijing', 'cn'),
('CN-TJ', 'Tianjin', 'cn'),
('CN-HE', 'Hebei', 'cn'),
('CN-SX', 'Shanxi', 'cn'),
('CN-NM', 'Inner Mongolia', 'cn'),
('CN-LN', 'Liaoning', 'cn'),
('CN-JL', 'Jilin', 'cn'),
('CN-HL', 'Heilongjiang', 'cn'),
('CN-SH', 'Shanghai', 'cn'),
('CN-JS', 'Jiangsu', 'cn'),
('CN-ZJ', 'Zhejiang', 'cn'),
('CN-AH', 'Anhui', 'cn'),
('CN-FJ', 'Fujian', 'cn'),
('CN-JX', 'Jiangxi', 'cn'),
('CN-SD', 'Shandong', 'cn'),
('CN-HA', 'Henan', 'cn'),
('CN-HB', 'Hubei', 'cn'),
('CN-HN', 'Hunan', 'cn'),
('CN-GD', 'Guangdong', 'cn'),
('CN-GX', 'Guangxi', 'cn'),
('CN-HI', 'Hainan', 'cn'),
('CN-CQ', 'Chongqing', 'cn'),
('CN-SC', 'Sichuan', 'cn'),
('CN-GZ', 'Guizhou', 'cn'),
('CN-YN', 'Yunnan', 'cn'),
('CN-XZ', 'Tibet', 'cn'),
('CN-SA', 'Shaanxi', 'cn'),
('CN-GS', 'Gansu', 'cn'),
('CN-QH', 'Qinghai', 'cn'),
('CN-NX', 'Ningxia', 'cn'),
('CN-XJ', 'Xinjiang', 'cn')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('CN-BJ', 'Beijing', 'cn'),
-- ('CN-TJ', 'Tianjin', 'cn'),
-- ('CN-HE', 'Hebei', 'cn'),
-- ('CN-SX', 'Shanxi', 'cn'),
-- ('CN-NM', 'Inner Mongolia', 'cn'),
-- ('CN-LN', 'Liaoning', 'cn'),
-- ('CN-JL', 'Jilin', 'cn'),
-- ('CN-HL', 'Heilongjiang', 'cn'),
-- ('CN-SH', 'Shanghai', 'cn'),
-- ('CN-JS', 'Jiangsu', 'cn'),
-- ('CN-ZJ', 'Zhejiang', 'cn'),
-- ('CN-AH', 'Anhui', 'cn'),
-- ('CN-FJ', 'Fujian', 'cn'),
-- ('CN-JX', 'Jiangxi', 'cn'),
-- ('CN-SD', 'Shandong', 'cn'),
-- ('CN-HA', 'Henan', 'cn'),
-- ('CN-HB', 'Hubei', 'cn'),
-- ('CN-HN', 'Hunan', 'cn'),
-- ('CN-GD', 'Guangdong', 'cn'),
-- ('CN-GX', 'Guangxi', 'cn'),
-- ('CN-HI', 'Hainan', 'cn'),
-- ('CN-CQ', 'Chongqing', 'cn'),
-- ('CN-SC', 'Sichuan', 'cn'),
-- ('CN-GZ', 'Guizhou', 'cn'),
-- ('CN-YN', 'Yunnan', 'cn'),
-- ('CN-XZ', 'Tibet', 'cn'),
-- ('CN-SA', 'Shaanxi', 'cn'),
-- ('CN-GS', 'Gansu', 'cn'),
-- ('CN-QH', 'Qinghai', 'cn'),
-- ('CN-NX', 'Ningxia', 'cn'),
-- ('CN-XJ', 'Xinjiang', 'cn')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,39 +1,39 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('IN-AN', 'Andaman and Nicobar Islands', 'in'),
('IN-AP', 'Andhra Pradesh', 'in'),
('IN-AR', 'Arunachal Pradesh', 'in'),
('IN-AS', 'Assam', 'in'),
('IN-BR', 'Bihar', 'in'),
('IN-CH', 'Chandigarh', 'in'),
('IN-CT', 'Chhattisgarh', 'in'),
('IN-DN', 'Dadra and Nagar Haveli and Daman and Diu', 'in'),
('IN-DD', 'Daman and Diu', 'in'), -- These IDs are consolidated now, but adding separately for compatibility
('IN-DL', 'Delhi', 'in'),
('IN-GA', 'Goa', 'in'),
('IN-GJ', 'Gujarat', 'in'),
('IN-HR', 'Haryana', 'in'),
('IN-HP', 'Himachal Pradesh', 'in'),
('IN-JH', 'Jharkhand', 'in'),
('IN-KA', 'Karnataka', 'in'),
('IN-KL', 'Kerala', 'in'),
('IN-LD', 'Lakshadweep', 'in'),
('IN-MP', 'Madhya Pradesh', 'in'),
('IN-MH', 'Maharashtra', 'in'),
('IN-MN', 'Manipur', 'in'),
('IN-ML', 'Meghalaya', 'in'),
('IN-MZ', 'Mizoram', 'in'),
('IN-NL', 'Nagaland', 'in'),
('IN-OR', 'Odisha', 'in'),
('IN-PY', 'Puducherry', 'in'),
('IN-PB', 'Punjab', 'in'),
('IN-RJ', 'Rajasthan', 'in'),
('IN-SK', 'Sikkim', 'in'),
('IN-TN', 'Tamil Nadu', 'in'),
('IN-TG', 'Telangana', 'in'),
('IN-TR', 'Tripura', 'in'),
('IN-UP', 'Uttar Pradesh', 'in'),
('IN-UT', 'Uttarakhand', 'in'),
('IN-WB', 'West Bengal', 'in')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('IN-AN', 'Andaman and Nicobar Islands', 'in'),
-- ('IN-AP', 'Andhra Pradesh', 'in'),
-- ('IN-AR', 'Arunachal Pradesh', 'in'),
-- ('IN-AS', 'Assam', 'in'),
-- ('IN-BR', 'Bihar', 'in'),
-- ('IN-CH', 'Chandigarh', 'in'),
-- ('IN-CT', 'Chhattisgarh', 'in'),
-- ('IN-DN', 'Dadra and Nagar Haveli and Daman and Diu', 'in'),
-- ('IN-DD', 'Daman and Diu', 'in'), -- These IDs are consolidated now, but adding separately for compatibility
-- ('IN-DL', 'Delhi', 'in'),
-- ('IN-GA', 'Goa', 'in'),
-- ('IN-GJ', 'Gujarat', 'in'),
-- ('IN-HR', 'Haryana', 'in'),
-- ('IN-HP', 'Himachal Pradesh', 'in'),
-- ('IN-JH', 'Jharkhand', 'in'),
-- ('IN-KA', 'Karnataka', 'in'),
-- ('IN-KL', 'Kerala', 'in'),
-- ('IN-LD', 'Lakshadweep', 'in'),
-- ('IN-MP', 'Madhya Pradesh', 'in'),
-- ('IN-MH', 'Maharashtra', 'in'),
-- ('IN-MN', 'Manipur', 'in'),
-- ('IN-ML', 'Meghalaya', 'in'),
-- ('IN-MZ', 'Mizoram', 'in'),
-- ('IN-NL', 'Nagaland', 'in'),
-- ('IN-OR', 'Odisha', 'in'),
-- ('IN-PY', 'Puducherry', 'in'),
-- ('IN-PB', 'Punjab', 'in'),
-- ('IN-RJ', 'Rajasthan', 'in'),
-- ('IN-SK', 'Sikkim', 'in'),
-- ('IN-TN', 'Tamil Nadu', 'in'),
-- ('IN-TG', 'Telangana', 'in'),
-- ('IN-TR', 'Tripura', 'in'),
-- ('IN-UP', 'Uttar Pradesh', 'in'),
-- ('IN-UT', 'Uttarakhand', 'in'),
-- ('IN-WB', 'West Bengal', 'in')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,12 +1,12 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('AU-NSW', 'New South Wales', 'au'),
('AU-VIC', 'Victoria', 'au'),
('AU-QLD', 'Queensland', 'au'),
('AU-SA', 'South Australia', 'au'),
('AU-WA', 'Western Australia', 'au'),
('AU-TAS', 'Tasmania', 'au'),
('AU-NT', 'Northern Territory', 'au'),
('AU-ACT', 'Australian Capital Territory', 'au')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('AU-NSW', 'New South Wales', 'au'),
-- ('AU-VIC', 'Victoria', 'au'),
-- ('AU-QLD', 'Queensland', 'au'),
-- ('AU-SA', 'South Australia', 'au'),
-- ('AU-WA', 'Western Australia', 'au'),
-- ('AU-TAS', 'Tasmania', 'au'),
-- ('AU-NT', 'Northern Territory', 'au'),
-- ('AU-ACT', 'Australian Capital Territory', 'au')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,20 +1,20 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('NZ-N', 'Northland', 'nz'),
('NZ-AUK', 'Auckland', 'nz'),
('NZ-WKO', 'Waikato', 'nz'),
('NZ-BOP', 'Bay of Plenty', 'nz'),
('NZ-GIS', 'Gisborne', 'nz'),
('NZ-HKB', 'Hawke''s Bay', 'nz'),
('NZ-TKI', 'Taranaki', 'nz'),
('NZ-MWT', 'Manawatū-Whanganui', 'nz'),
('NZ-WGN', 'Wellington', 'nz'),
('NZ-TAS', 'Tasman', 'nz'),
('NZ-NEL', 'Nelson', 'nz'),
('NZ-MBH', 'Marlborough', 'nz'),
('NZ-WTC', 'West Coast', 'nz'),
('NZ-CAN', 'Canterbury', 'nz'),
('NZ-OTA', 'Otago', 'nz'),
('NZ-STL', 'Southland', 'nz')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('NZ-N', 'Northland', 'nz'),
-- ('NZ-AUK', 'Auckland', 'nz'),
-- ('NZ-WKO', 'Waikato', 'nz'),
-- ('NZ-BOP', 'Bay of Plenty', 'nz'),
-- ('NZ-GIS', 'Gisborne', 'nz'),
-- ('NZ-HKB', 'Hawke''s Bay', 'nz'),
-- ('NZ-TKI', 'Taranaki', 'nz'),
-- ('NZ-MWT', 'Manawatū-Whanganui', 'nz'),
-- ('NZ-WGN', 'Wellington', 'nz'),
-- ('NZ-TAS', 'Tasman', 'nz'),
-- ('NZ-NEL', 'Nelson', 'nz'),
-- ('NZ-MBH', 'Marlborough', 'nz'),
-- ('NZ-WTC', 'West Coast', 'nz'),
-- ('NZ-CAN', 'Canterbury', 'nz'),
-- ('NZ-OTA', 'Otago', 'nz'),
-- ('NZ-STL', 'Southland', 'nz')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,13 +1,13 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('ZA-EC', 'Eastern Cape', 'za'),
('ZA-FS', 'Free State', 'za'),
('ZA-GP', 'Gauteng', 'za'),
('ZA-KZN', 'KwaZulu-Natal', 'za'),
('ZA-LP', 'Limpopo', 'za'),
('ZA-MP', 'Mpumalanga', 'za'),
('ZA-NW', 'North West', 'za'),
('ZA-NC', 'Northern Cape', 'za'),
('ZA-WC', 'Western Cape', 'za')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('ZA-EC', 'Eastern Cape', 'za'),
-- ('ZA-FS', 'Free State', 'za'),
-- ('ZA-GP', 'Gauteng', 'za'),
-- ('ZA-KZN', 'KwaZulu-Natal', 'za'),
-- ('ZA-LP', 'Limpopo', 'za'),
-- ('ZA-MP', 'Mpumalanga', 'za'),
-- ('ZA-NW', 'North West', 'za'),
-- ('ZA-NC', 'Northern Cape', 'za'),
-- ('ZA-WC', 'Western Cape', 'za')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,31 +1,31 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('EG-ALX', 'Alexandria', 'eg'),
('EG-ASN', 'Aswan', 'eg'),
('EG-ASY', 'Asyut', 'eg'),
('EG-BHR', 'Beheira', 'eg'),
('EG-BNS', 'Beni Suef', 'eg'),
('EG-C', 'Cairo', 'eg'),
('EG-DK', 'Dakahlia', 'eg'),
('EG-DAM', 'Damietta', 'eg'),
('EG-FYM', 'Faiyum', 'eg'),
('EG-GH', 'Gharbia', 'eg'),
('EG-GZ', 'Giza', 'eg'),
('EG-IS', 'Ismailia', 'eg'),
('EG-KB', 'Kafr El Sheikh', 'eg'),
('EG-LX', 'Luxor', 'eg'),
('EG-MN', 'Minya', 'eg'),
('EG-MT', 'Matrouh', 'eg'),
('EG-QH', 'Qalyubia', 'eg'),
('EG-KFS', 'Qena', 'eg'),
('EG-SHG', 'Sohag', 'eg'),
('EG-SHR', 'Sharqia', 'eg'),
('EG-SIN', 'South Sinai', 'eg'),
('EG-SW', 'Suez', 'eg'),
('EG-WAD', 'New Valley', 'eg'),
('EG-ASD', 'North Sinai', 'eg'),
('EG-PTS', 'Port Said', 'eg'),
('EG-SKB', 'Suez', 'eg'),
('EG-ESI', 'Ismailia', 'eg')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('EG-ALX', 'Alexandria', 'eg'),
-- ('EG-ASN', 'Aswan', 'eg'),
-- ('EG-ASY', 'Asyut', 'eg'),
-- ('EG-BHR', 'Beheira', 'eg'),
-- ('EG-BNS', 'Beni Suef', 'eg'),
-- ('EG-C', 'Cairo', 'eg'),
-- ('EG-DK', 'Dakahlia', 'eg'),
-- ('EG-DAM', 'Damietta', 'eg'),
-- ('EG-FYM', 'Faiyum', 'eg'),
-- ('EG-GH', 'Gharbia', 'eg'),
-- ('EG-GZ', 'Giza', 'eg'),
-- ('EG-IS', 'Ismailia', 'eg'),
-- ('EG-KB', 'Kafr El Sheikh', 'eg'),
-- ('EG-LX', 'Luxor', 'eg'),
-- ('EG-MN', 'Minya', 'eg'),
-- ('EG-MT', 'Matrouh', 'eg'),
-- ('EG-QH', 'Qalyubia', 'eg'),
-- ('EG-KFS', 'Qena', 'eg'),
-- ('EG-SHG', 'Sohag', 'eg'),
-- ('EG-SHR', 'Sharqia', 'eg'),
-- ('EG-SIN', 'South Sinai', 'eg'),
-- ('EG-SW', 'Suez', 'eg'),
-- ('EG-WAD', 'New Valley', 'eg'),
-- ('EG-ASD', 'North Sinai', 'eg'),
-- ('EG-PTS', 'Port Said', 'eg'),
-- ('EG-SKB', 'Suez', 'eg'),
-- ('EG-ESI', 'Ismailia', 'eg')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,31 +1,31 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('BR-AC', 'Acre', 'br'),
('BR-AL', 'Alagoas', 'br'),
('BR-AP', 'Amapá', 'br'),
('BR-AM', 'Amazonas', 'br'),
('BR-BA', 'Bahia', 'br'),
('BR-CE', 'Ceará', 'br'),
('BR-DF', 'Federal District', 'br'),
('BR-ES', 'Espírito Santo', 'br'),
('BR-GO', 'Goiás', 'br'),
('BR-MA', 'Maranhão', 'br'),
('BR-MT', 'Mato Grosso', 'br'),
('BR-MS', 'Mato Grosso do Sul', 'br'),
('BR-MG', 'Minas Gerais', 'br'),
('BR-PA', 'Pará', 'br'),
('BR-PB', 'Paraíba', 'br'),
('BR-PR', 'Paraná', 'br'),
('BR-PE', 'Pernambuco', 'br'),
('BR-PI', 'Piauí', 'br'),
('BR-RJ', 'Rio de Janeiro', 'br'),
('BR-RN', 'Rio Grande do Norte', 'br'),
('BR-RS', 'Rio Grande do Sul', 'br'),
('BR-RO', 'Rondônia', 'br'),
('BR-RR', 'Roraima', 'br'),
('BR-SC', 'Santa Catarina', 'br'),
('BR-SP', 'São Paulo', 'br'),
('BR-SE', 'Sergipe', 'br'),
('BR-TO', 'Tocantins', 'br')
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('BR-AC', 'Acre', 'br'),
-- ('BR-AL', 'Alagoas', 'br'),
-- ('BR-AP', 'Amapá', 'br'),
-- ('BR-AM', 'Amazonas', 'br'),
-- ('BR-BA', 'Bahia', 'br'),
-- ('BR-CE', 'Ceará', 'br'),
-- ('BR-DF', 'Federal District', 'br'),
-- ('BR-ES', 'Espírito Santo', 'br'),
-- ('BR-GO', 'Goiás', 'br'),
-- ('BR-MA', 'Maranhão', 'br'),
-- ('BR-MT', 'Mato Grosso', 'br'),
-- ('BR-MS', 'Mato Grosso do Sul', 'br'),
-- ('BR-MG', 'Minas Gerais', 'br'),
-- ('BR-PA', 'Pará', 'br'),
-- ('BR-PB', 'Paraíba', 'br'),
-- ('BR-PR', 'Paraná', 'br'),
-- ('BR-PE', 'Pernambuco', 'br'),
-- ('BR-PI', 'Piauí', 'br'),
-- ('BR-RJ', 'Rio de Janeiro', 'br'),
-- ('BR-RN', 'Rio Grande do Norte', 'br'),
-- ('BR-RS', 'Rio Grande do Sul', 'br'),
-- ('BR-RO', 'Rondônia', 'br'),
-- ('BR-RR', 'Roraima', 'br'),
-- ('BR-SC', 'Santa Catarina', 'br'),
-- ('BR-SP', 'São Paulo', 'br'),
-- ('BR-SE', 'Sergipe', 'br'),
-- ('BR-TO', 'Tocantins', 'br')
ON CONFLICT (id) DO NOTHING;
-- ON CONFLICT (id) DO NOTHING;

View file

@ -1,15 +0,0 @@
-- INSERT INTO "adventures" (name, location) VALUES
-- ('Yellowstone National Park', 'Wyoming, Montana, Idaho, USA'),
-- ('Yosemite National Park', 'California, USA'),
-- ('Banff National Park', 'Alberta, Canada'),
-- ('Kruger National Park', 'Limpopo, South Africa'),
-- ('Grand Canyon National Park', 'Arizona, USA'),
-- ('Great Smoky Mountains National Park', 'North Carolina, Tennessee, USA'),
-- ('Zion National Park', 'Utah, USA'),
-- ('Glacier National Park', 'Montana, USA'),
-- ('Rocky Mountain National Park', 'Colorado, USA'),
-- ('Everglades National Park', 'Florida, USA'),
-- ('Arches National Park', 'Utah, USA'),
-- ('Acadia National Park', 'Maine, USA'),
-- ('Sequoia National Park', 'California, USA')
-- ON CONFLICT (name) DO NOTHING;

505
src/lib/db/insertData.ts Normal file
View file

@ -0,0 +1,505 @@
import { sql } from "drizzle-orm";
import { db } from "./db.server";
export async function insertData() {
// insets default featured adventures
console.log("Inserting default featured adventures...");
await db.execute(sql`INSERT INTO "adventures" (name, location, type) VALUES
('Yellowstone National Park', 'Wyoming, Montana, Idaho, USA', 'featured'),
('Yosemite National Park', 'California, USA', 'featured'),
('Banff National Park', 'Alberta, Canada', 'featured'),
('Kruger National Park', 'Limpopo, South Africa', 'featured'),
('Grand Canyon National Park', 'Arizona, USA', 'featured'),
('Great Smoky Mountains National Park', 'North Carolina, Tennessee, USA', 'featured'),
('Zion National Park', 'Utah, USA', 'featured'),
('Glacier National Park', 'Montana, USA', 'featured'),
('Rocky Mountain National Park', 'Colorado, USA', 'featured'),
('Everglades National Park', 'Florida, USA', 'featured'),
('Arches National Park', 'Utah, USA', 'featured'),
('Acadia National Park', 'Maine, USA', 'featured'),
('Sequoia National Park', 'California, USA', 'featured');`);
console.log("Inserting countries...");
await db.execute(sql`INSERT INTO "worldTravelCountries" (name, country_code, continent)
VALUES
('United States', 'us', 'North America'),
('Canada', 'ca', 'North America'),
('Mexico', 'mx', 'North America'),
('Brazil', 'br', 'South America'),
('Argentina', 'ar', 'South America'),
('United Kingdom', 'gb', 'Europe'),
('Germany', 'de', 'Europe'),
('France', 'fr', 'Europe'),
('Japan', 'jp', 'Asia'),
('China', 'cn', 'Asia'),
('India', 'in', 'Asia'),
('Australia', 'au', 'Oceania'),
('New Zealand', 'nz', 'Oceania'),
('South Africa', 'za', 'Africa'),
('Egypt', 'eg', 'Africa')
ON CONFLICT (country_code) DO NOTHING;`);
console.log("Inserting regions...");
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code) VALUES
('US-AL', 'Alabama', 'us'),
('US-AK', 'Alaska', 'us'),
('US-AZ', 'Arizona', 'us'),
('US-AR', 'Arkansas', 'us'),
('US-CA', 'California', 'us'),
('US-CO', 'Colorado', 'us'),
('US-CT', 'Connecticut', 'us'),
('US-DE', 'Delaware', 'us'),
('US-FL', 'Florida', 'us'),
('US-GA', 'Georgia', 'us'),
('US-HI', 'Hawaii', 'us'),
('US-ID', 'Idaho', 'us'),
('US-IL', 'Illinois', 'us'),
('US-IN', 'Indiana', 'us'),
('US-IA', 'Iowa', 'us'),
('US-KS', 'Kansas', 'us'),
('US-KY', 'Kentucky', 'us'),
('US-LA', 'Louisiana', 'us'),
('US-ME', 'Maine', 'us'),
('US-MD', 'Maryland', 'us'),
('US-MA', 'Massachusetts', 'us'),
('US-MI', 'Michigan', 'us'),
('US-MN', 'Minnesota', 'us'),
('US-MS', 'Mississippi', 'us'),
('US-MO', 'Missouri', 'us'),
('US-MT', 'Montana', 'us'),
('US-NE', 'Nebraska', 'us'),
('US-NV', 'Nevada', 'us'),
('US-NH', 'New Hampshire', 'us'),
('US-NJ', 'New Jersey', 'us'),
('US-NM', 'New Mexico', 'us'),
('US-NY', 'New York', 'us'),
('US-NC', 'North Carolina', 'us'),
('US-ND', 'North Dakota', 'us'),
('US-OH', 'Ohio', 'us'),
('US-OK', 'Oklahoma', 'us'),
('US-OR', 'Oregon', 'us'),
('US-PA', 'Pennsylvania', 'us'),
('US-RI', 'Rhode Island', 'us'),
('US-SC', 'South Carolina', 'us'),
('US-SD', 'South Dakota', 'us'),
('US-TN', 'Tennessee', 'us'),
('US-TX', 'Texas', 'us'),
('US-UT', 'Utah', 'us'),
('US-VT', 'Vermont', 'us'),
('US-VA', 'Virginia', 'us'),
('US-WA', 'Washington', 'us'),
('US-WV', 'West Virginia', 'us'),
('US-WI', 'Wisconsin', 'us'),
('US-WY', 'Wyoming', 'us')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('CA-AB', 'Alberta', 'ca'),
('CA-BC', 'British Columbia', 'ca'),
('CA-MB', 'Manitoba', 'ca'),
('CA-NB', 'New Brunswick', 'ca'),
('CA-NL', 'Newfoundland and Labrador', 'ca'),
('CA-NS', 'Nova Scotia', 'ca'),
('CA-ON', 'Ontario', 'ca'),
('CA-PE', 'Prince Edward Island', 'ca'),
('CA-QC', 'Quebec', 'ca'),
('CA-SK', 'Saskatchewan', 'ca'),
('CA-NT', 'Northwest Territories', 'ca'),
('CA-NU', 'Nunavut', 'ca'),
('CA-YT', 'Yukon', 'ca')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('DE-BW', 'Baden-Württemberg', 'de'),
('DE-BY', 'Bavaria', 'de'),
('DE-BE', 'Berlin', 'de'),
('DE-BB', 'Brandenburg', 'de'),
('DE-HB', 'Bremen', 'de'),
('DE-HH', 'Hamburg', 'de'),
('DE-HE', 'Hesse', 'de'),
('DE-NI', 'Lower Saxony', 'de'),
('DE-MV', 'Mecklenburg-Vorpommern', 'de'),
('DE-NW', 'North Rhine-Westphalia', 'de'),
('DE-RP', 'Rhineland-Palatinate', 'de'),
('DE-SL', 'Saarland', 'de'),
('DE-SN', 'Saxony', 'de'),
('DE-ST', 'Saxony-Anhalt', 'de'),
('DE-SH', 'Schleswig-Holstein', 'de'),
('DE-TH', 'Thuringia', 'de')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('FR-ARA', 'Auvergne-Rhône-Alpes', 'fr'),
('FR-BFC', 'Bourgogne-Franche-Comté', 'fr'),
('FR-BRE', 'Brittany', 'fr'),
('FR-CVL', 'Centre-Val de Loire', 'fr'),
('FR-GES', 'Grand Est', 'fr'),
('FR-HDF', 'Hauts-de-France', 'fr'),
('FR-IDF', 'Île-de-France', 'fr'),
('FR-NOR', 'Normandy', 'fr'),
('FR-NAQ', 'Nouvelle-Aquitaine', 'fr'),
('FR-OCC', 'Occitanie', 'fr'),
('FR-PDL', 'Pays de la Loire', 'fr'),
('FR-PAC', 'Provence-Alpes-Côte d''Azur', 'fr'),
('FR-COR', 'Corsica', 'fr'),
('FR-MQ', 'Martinique', 'fr'),
('FR-GF', 'French Guiana', 'fr'),
('FR-RÉ', 'Réunion', 'fr'),
('FR-YT', 'Mayotte', 'fr'),
('FR-GP', 'Guadeloupe', 'fr')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('GB-ENG', 'England', 'gb'),
('GB-NIR', 'Northern Ireland', 'gb'),
('GB-SCT', 'Scotland', 'gb'),
('GB-WLS', 'Wales', 'gb')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('AR-C', 'Ciudad Autónoma de Buenos Aires', 'ar'),
('AR-B', 'Buenos Aires', 'ar'),
('AR-K', 'Catamarca', 'ar'),
('AR-H', 'Chaco', 'ar'),
('AR-U', 'Chubut', 'ar'),
('AR-W', 'Córdoba', 'ar'),
('AR-X', 'Corrientes', 'ar'),
('AR-E', 'Entre Ríos', 'ar'),
('AR-P', 'Formosa', 'ar'),
('AR-Y', 'Jujuy', 'ar'),
('AR-L', 'La Pampa', 'ar'),
('AR-F', 'La Rioja', 'ar'),
('AR-M', 'Mendoza', 'ar'),
('AR-N', 'Misiones', 'ar'),
('AR-Q', 'Neuquén', 'ar'),
('AR-R', 'Río Negro', 'ar'),
('AR-A', 'Salta', 'ar'),
('AR-J', 'San Juan', 'ar'),
('AR-D', 'San Luis', 'ar'),
('AR-Z', 'Santa Cruz', 'ar'),
('AR-S', 'Santa Fe', 'ar'),
('AR-G', 'Santiago del Estero', 'ar'),
('AR-V', 'Tierra del Fuego', 'ar'),
('AR-T', 'Tucumán', 'ar')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('MX-AGU', 'Aguascalientes', 'mx'),
('MX-BCN', 'Baja California', 'mx'),
('MX-BCS', 'Baja California Sur', 'mx'),
('MX-CAM', 'Campeche', 'mx'),
('MX-CHP', 'Chiapas', 'mx'),
('MX-CHH', 'Chihuahua', 'mx'),
('MX-COA', 'Coahuila', 'mx'),
('MX-COL', 'Colima', 'mx'),
('MX-DUR', 'Durango', 'mx'),
('MX-GUA', 'Guanajuato', 'mx'),
('MX-GRO', 'Guerrero', 'mx'),
('MX-HID', 'Hidalgo', 'mx'),
('MX-JAL', 'Jalisco', 'mx'),
('MX-MEX', 'State of Mexico', 'mx'),
('MX-MIC', 'Michoacán', 'mx'),
('MX-MOR', 'Morelos', 'mx'),
('MX-NAY', 'Nayarit', 'mx'),
('MX-NLE', 'Nuevo León', 'mx'),
('MX-OAX', 'Oaxaca', 'mx'),
('MX-PUE', 'Puebla', 'mx'),
('MX-QUE', 'Querétaro', 'mx'),
('MX-ROO', 'Quintana Roo', 'mx'),
('MX-SLP', 'San Luis Potosí', 'mx'),
('MX-SIN', 'Sinaloa', 'mx'),
('MX-SON', 'Sonora', 'mx'),
('MX-TAB', 'Tabasco', 'mx'),
('MX-TAM', 'Tamaulipas', 'mx'),
('MX-TLA', 'Tlaxcala', 'mx'),
('MX-VER', 'Veracruz', 'mx'),
('MX-YUC', 'Yucatán', 'mx'),
('MX-ZAC', 'Zacatecas', 'mx')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('JP-01', 'Hokkaido', 'jp'),
('JP-02', 'Aomori', 'jp'),
('JP-03', 'Iwate', 'jp'),
('JP-04', 'Miyagi', 'jp'),
('JP-05', 'Akita', 'jp'),
('JP-06', 'Yamagata', 'jp'),
('JP-07', 'Fukushima', 'jp'),
('JP-08', 'Ibaraki', 'jp'),
('JP-09', 'Tochigi', 'jp'),
('JP-10', 'Gunma', 'jp'),
('JP-11', 'Saitama', 'jp'),
('JP-12', 'Chiba', 'jp'),
('JP-13', 'Tokyo', 'jp'),
('JP-14', 'Kanagawa', 'jp'),
('JP-15', 'Niigata', 'jp'),
('JP-16', 'Toyama', 'jp'),
('JP-17', 'Ishikawa', 'jp'),
('JP-18', 'Fukui', 'jp'),
('JP-19', 'Yamanashi', 'jp'),
('JP-20', 'Nagano', 'jp'),
('JP-21', 'Gifu', 'jp'),
('JP-22', 'Shizuoka', 'jp'),
('JP-23', 'Aichi', 'jp'),
('JP-24', 'Mie', 'jp'),
('JP-25', 'Shiga', 'jp'),
('JP-26', 'Kyoto', 'jp'),
('JP-27', 'Osaka', 'jp'),
('JP-28', 'Hyogo', 'jp'),
('JP-29', 'Nara', 'jp'),
('JP-30', 'Wakayama', 'jp'),
('JP-31', 'Tottori', 'jp'),
('JP-32', 'Shimane', 'jp'),
('JP-33', 'Okayama', 'jp'),
('JP-34', 'Hiroshima', 'jp'),
('JP-35', 'Yamaguchi', 'jp'),
('JP-36', 'Tokushima', 'jp'),
('JP-37', 'Kagawa', 'jp'),
('JP-38', 'Ehime', 'jp'),
('JP-39', 'Kochi', 'jp'),
('JP-40', 'Fukuoka', 'jp'),
('JP-41', 'Saga', 'jp'),
('JP-42', 'Nagasaki', 'jp'),
('JP-43', 'Kumamoto', 'jp'),
('JP-44', 'Oita', 'jp'),
('JP-45', 'Miyazaki', 'jp'),
('JP-46', 'Kagoshima', 'jp'),
('JP-47', 'Okinawa', 'jp')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('CN-BJ', 'Beijing', 'cn'),
('CN-TJ', 'Tianjin', 'cn'),
('CN-HE', 'Hebei', 'cn'),
('CN-SX', 'Shanxi', 'cn'),
('CN-NM', 'Inner Mongolia', 'cn'),
('CN-LN', 'Liaoning', 'cn'),
('CN-JL', 'Jilin', 'cn'),
('CN-HL', 'Heilongjiang', 'cn'),
('CN-SH', 'Shanghai', 'cn'),
('CN-JS', 'Jiangsu', 'cn'),
('CN-ZJ', 'Zhejiang', 'cn'),
('CN-AH', 'Anhui', 'cn'),
('CN-FJ', 'Fujian', 'cn'),
('CN-JX', 'Jiangxi', 'cn'),
('CN-SD', 'Shandong', 'cn'),
('CN-HA', 'Henan', 'cn'),
('CN-HB', 'Hubei', 'cn'),
('CN-HN', 'Hunan', 'cn'),
('CN-GD', 'Guangdong', 'cn'),
('CN-GX', 'Guangxi', 'cn'),
('CN-HI', 'Hainan', 'cn'),
('CN-CQ', 'Chongqing', 'cn'),
('CN-SC', 'Sichuan', 'cn'),
('CN-GZ', 'Guizhou', 'cn'),
('CN-YN', 'Yunnan', 'cn'),
('CN-XZ', 'Tibet', 'cn'),
('CN-SA', 'Shaanxi', 'cn'),
('CN-GS', 'Gansu', 'cn'),
('CN-QH', 'Qinghai', 'cn'),
('CN-NX', 'Ningxia', 'cn'),
('CN-XJ', 'Xinjiang', 'cn')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('IN-AN', 'Andaman and Nicobar Islands', 'in'),
('IN-AP', 'Andhra Pradesh', 'in'),
('IN-AR', 'Arunachal Pradesh', 'in'),
('IN-AS', 'Assam', 'in'),
('IN-BR', 'Bihar', 'in'),
('IN-CH', 'Chandigarh', 'in'),
('IN-CT', 'Chhattisgarh', 'in'),
('IN-DN', 'Dadra and Nagar Haveli and Daman and Diu', 'in'),
('IN-DD', 'Daman and Diu', 'in'), -- These IDs are consolidated now, but adding separately for compatibility
('IN-DL', 'Delhi', 'in'),
('IN-GA', 'Goa', 'in'),
('IN-GJ', 'Gujarat', 'in'),
('IN-HR', 'Haryana', 'in'),
('IN-HP', 'Himachal Pradesh', 'in'),
('IN-JH', 'Jharkhand', 'in'),
('IN-KA', 'Karnataka', 'in'),
('IN-KL', 'Kerala', 'in'),
('IN-LD', 'Lakshadweep', 'in'),
('IN-MP', 'Madhya Pradesh', 'in'),
('IN-MH', 'Maharashtra', 'in'),
('IN-MN', 'Manipur', 'in'),
('IN-ML', 'Meghalaya', 'in'),
('IN-MZ', 'Mizoram', 'in'),
('IN-NL', 'Nagaland', 'in'),
('IN-OR', 'Odisha', 'in'),
('IN-PY', 'Puducherry', 'in'),
('IN-PB', 'Punjab', 'in'),
('IN-RJ', 'Rajasthan', 'in'),
('IN-SK', 'Sikkim', 'in'),
('IN-TN', 'Tamil Nadu', 'in'),
('IN-TG', 'Telangana', 'in'),
('IN-TR', 'Tripura', 'in'),
('IN-UP', 'Uttar Pradesh', 'in'),
('IN-UT', 'Uttarakhand', 'in'),
('IN-WB', 'West Bengal', 'in')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('AU-NSW', 'New South Wales', 'au'),
('AU-VIC', 'Victoria', 'au'),
('AU-QLD', 'Queensland', 'au'),
('AU-SA', 'South Australia', 'au'),
('AU-WA', 'Western Australia', 'au'),
('AU-TAS', 'Tasmania', 'au'),
('AU-NT', 'Northern Territory', 'au'),
('AU-ACT', 'Australian Capital Territory', 'au')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('NZ-N', 'Northland', 'nz'),
('NZ-AUK', 'Auckland', 'nz'),
('NZ-WKO', 'Waikato', 'nz'),
('NZ-BOP', 'Bay of Plenty', 'nz'),
('NZ-GIS', 'Gisborne', 'nz'),
('NZ-HKB', 'Hawke''s Bay', 'nz'),
('NZ-TKI', 'Taranaki', 'nz'),
('NZ-MWT', 'Manawatū-Whanganui', 'nz'),
('NZ-WGN', 'Wellington', 'nz'),
('NZ-TAS', 'Tasman', 'nz'),
('NZ-NEL', 'Nelson', 'nz'),
('NZ-MBH', 'Marlborough', 'nz'),
('NZ-WTC', 'West Coast', 'nz'),
('NZ-CAN', 'Canterbury', 'nz'),
('NZ-OTA', 'Otago', 'nz'),
('NZ-STL', 'Southland', 'nz')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('ZA-EC', 'Eastern Cape', 'za'),
('ZA-FS', 'Free State', 'za'),
('ZA-GP', 'Gauteng', 'za'),
('ZA-KZN', 'KwaZulu-Natal', 'za'),
('ZA-LP', 'Limpopo', 'za'),
('ZA-MP', 'Mpumalanga', 'za'),
('ZA-NW', 'North West', 'za'),
('ZA-NC', 'Northern Cape', 'za'),
('ZA-WC', 'Western Cape', 'za')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('EG-ALX', 'Alexandria', 'eg'),
('EG-ASN', 'Aswan', 'eg'),
('EG-ASY', 'Asyut', 'eg'),
('EG-BHR', 'Beheira', 'eg'),
('EG-BNS', 'Beni Suef', 'eg'),
('EG-C', 'Cairo', 'eg'),
('EG-DK', 'Dakahlia', 'eg'),
('EG-DAM', 'Damietta', 'eg'),
('EG-FYM', 'Faiyum', 'eg'),
('EG-GH', 'Gharbia', 'eg'),
('EG-GZ', 'Giza', 'eg'),
('EG-IS', 'Ismailia', 'eg'),
('EG-KB', 'Kafr El Sheikh', 'eg'),
('EG-LX', 'Luxor', 'eg'),
('EG-MN', 'Minya', 'eg'),
('EG-MT', 'Matrouh', 'eg'),
('EG-QH', 'Qalyubia', 'eg'),
('EG-KFS', 'Qena', 'eg'),
('EG-SHG', 'Sohag', 'eg'),
('EG-SHR', 'Sharqia', 'eg'),
('EG-SIN', 'South Sinai', 'eg'),
('EG-SW', 'Suez', 'eg'),
('EG-WAD', 'New Valley', 'eg'),
('EG-ASD', 'North Sinai', 'eg'),
('EG-PTS', 'Port Said', 'eg'),
('EG-SKB', 'Suez', 'eg'),
('EG-ESI', 'Ismailia', 'eg')
ON CONFLICT (id) DO NOTHING;
`);
await db.execute(sql`INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('BR-AC', 'Acre', 'br'),
('BR-AL', 'Alagoas', 'br'),
('BR-AP', 'Amapá', 'br'),
('BR-AM', 'Amazonas', 'br'),
('BR-BA', 'Bahia', 'br'),
('BR-CE', 'Ceará', 'br'),
('BR-DF', 'Federal District', 'br'),
('BR-ES', 'Espírito Santo', 'br'),
('BR-GO', 'Goiás', 'br'),
('BR-MA', 'Maranhão', 'br'),
('BR-MT', 'Mato Grosso', 'br'),
('BR-MS', 'Mato Grosso do Sul', 'br'),
('BR-MG', 'Minas Gerais', 'br'),
('BR-PA', 'Pará', 'br'),
('BR-PB', 'Paraíba', 'br'),
('BR-PR', 'Paraná', 'br'),
('BR-PE', 'Pernambuco', 'br'),
('BR-PI', 'Piauí', 'br'),
('BR-RJ', 'Rio de Janeiro', 'br'),
('BR-RN', 'Rio Grande do Norte', 'br'),
('BR-RS', 'Rio Grande do Sul', 'br'),
('BR-RO', 'Rondônia', 'br'),
('BR-RR', 'Roraima', 'br'),
('BR-SC', 'Santa Catarina', 'br'),
('BR-SP', 'São Paulo', 'br'),
('BR-SE', 'Sergipe', 'br'),
('BR-TO', 'Tocantins', 'br')
ON CONFLICT (id) DO NOTHING;
`);
}

View file

@ -107,9 +107,7 @@ export const userPlannedAdventures = pgTable("userPlannedAdventures", {
export const adventureTable = pgTable("adventures", {
id: serial("id").primaryKey(),
type: text("type").notNull(),
userId: text("userId")
.notNull()
.references(() => userTable.id),
userId: text("userId").references(() => userTable.id),
name: text("name").notNull(),
location: text("location"),
activityTypes: json("activityTypes"),

View file

@ -1,12 +1,14 @@
import { db } from "$lib/db/db.server";
import { featuredAdventures } from "$lib/db/schema";
import { adventureTable, featuredAdventures } from "$lib/db/schema";
import type { Adventure } from "$lib/utils/types";
import { eq } from "drizzle-orm";
export const load = async () => {
const result = await db
.select()
.from(featuredAdventures)
.orderBy(featuredAdventures.id);
.from(adventureTable)
.where(eq(adventureTable.type, "featured"))
.orderBy(adventureTable.id);
return {
result: result as Adventure[],
};

View file

@ -8,7 +8,8 @@ import type { DatabaseUser } from "$lib/server/auth";
import type { Actions } from "./$types";
import { userTable } from "$lib/db/schema";
import { eq } from "drizzle-orm";
import { eq, sql } from "drizzle-orm";
import { insertData } from "$lib/db/insertData";
export const actions: Actions = {
default: async (event) => {
@ -109,8 +110,11 @@ export const actions: Actions = {
} as DatabaseUser)
.execute();
const session = await lucia.createSession(userId, {});
const sessionCookie = lucia.createSessionCookie(session.id);
// inserts the data needed for all of the pre defined adventures and world travel regions
await insertData();
const session: any = await lucia.createSession(userId, {});
const sessionCookie: any = lucia.createSessionCookie(session.id);
event.cookies.set(sessionCookie.name, sessionCookie.value, {
path: ".",
...sessionCookie.attributes,

View file

@ -44,7 +44,7 @@ fi
npm run migrate
# Run SQL scripts
run_sql_scripts
# run_sql_scripts
echo "The origin to be set is: $ORIGIN"
# Start the application