mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-02 03:35:18 +02:00
Add unique constraints to featuredAdventures and worldTravelCountryRegions tables, and insert data for Canada, Germany, and the US regions.
This commit is contained in:
parent
8a8a118309
commit
a17234ab6b
11 changed files with 756 additions and 85 deletions
1
migrations/0010_closed_nicolaos.sql
Normal file
1
migrations/0010_closed_nicolaos.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE "featuredAdventures" ADD CONSTRAINT "featuredAdventures_name_unique" UNIQUE("name");
|
1
migrations/0011_legal_red_hulk.sql
Normal file
1
migrations/0011_legal_red_hulk.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE "worldTravelCountryRegions" ADD CONSTRAINT "worldTravelCountryRegions_name_unique" UNIQUE("name");
|
311
migrations/meta/0010_snapshot.json
Normal file
311
migrations/meta/0010_snapshot.json
Normal file
|
@ -0,0 +1,311 @@
|
|||
{
|
||||
"id": "988ebc41-0384-43ed-a4dc-acaf5f14f88b",
|
||||
"prevId": "309515d8-823e-493d-96c2-aef7ff79a953",
|
||||
"version": "5",
|
||||
"dialect": "pg",
|
||||
"tables": {
|
||||
"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": {}
|
||||
},
|
||||
"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
|
||||
}
|
||||
},
|
||||
"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": {}
|
||||
},
|
||||
"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": "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
|
||||
}
|
||||
},
|
||||
"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": {}
|
||||
}
|
||||
}
|
319
migrations/meta/0011_snapshot.json
Normal file
319
migrations/meta/0011_snapshot.json
Normal file
|
@ -0,0 +1,319 @@
|
|||
{
|
||||
"id": "341b817a-4a1f-43ea-9e49-34769fca6da8",
|
||||
"prevId": "988ebc41-0384-43ed-a4dc-acaf5f14f88b",
|
||||
"version": "5",
|
||||
"dialect": "pg",
|
||||
"tables": {
|
||||
"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": {}
|
||||
},
|
||||
"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
|
||||
}
|
||||
},
|
||||
"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": {}
|
||||
},
|
||||
"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": "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
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"worldTravelCountryRegions_name_unique": {
|
||||
"name": "worldTravelCountryRegions_name_unique",
|
||||
"nullsNotDistinct": false,
|
||||
"columns": [
|
||||
"name"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"enums": {},
|
||||
"schemas": {},
|
||||
"_meta": {
|
||||
"columns": {},
|
||||
"schemas": {},
|
||||
"tables": {}
|
||||
}
|
||||
}
|
|
@ -71,6 +71,20 @@
|
|||
"when": 1712880141763,
|
||||
"tag": "0009_zippy_domino",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 10,
|
||||
"version": "5",
|
||||
"when": 1712884724835,
|
||||
"tag": "0010_closed_nicolaos",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 11,
|
||||
"version": "5",
|
||||
"when": 1712885083355,
|
||||
"tag": "0011_legal_red_hulk",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
17
sql/ca.sql
Normal file
17
sql/ca.sql
Normal file
|
@ -0,0 +1,17 @@
|
|||
INSERT INTO "worldTravelCountryRegions" (name, country_code)
|
||||
VALUES
|
||||
('Alberta', 'ca'),
|
||||
('British Columbia', 'ca'),
|
||||
('Manitoba', 'ca'),
|
||||
('New Brunswick', 'ca'),
|
||||
('Newfoundland and Labrador', 'ca'),
|
||||
('Nova Scotia', 'ca'),
|
||||
('Ontario', 'ca'),
|
||||
('Prince Edward Island', 'ca'),
|
||||
('Quebec', 'ca'),
|
||||
('Saskatchewan', 'ca'),
|
||||
('Northwest Territories', 'ca'),
|
||||
('Nunavut', 'ca'),
|
||||
('Yukon', 'ca');
|
||||
|
||||
ON CONFLICT (name) DO NOTHING;
|
|
@ -14,4 +14,5 @@ VALUES
|
|||
('Australia', 'au', 'Oceania'),
|
||||
('New Zealand', 'nz', 'Oceania'),
|
||||
('South Africa', 'za', 'Africa'),
|
||||
('Egypt', 'eg', 'Africa');
|
||||
('Egypt', 'eg', 'Africa'),
|
||||
ON CONFLICT (country_code) DO NOTHING;
|
20
sql/de.sql
Normal file
20
sql/de.sql
Normal file
|
@ -0,0 +1,20 @@
|
|||
INSERT INTO "worldTravelCountryRegions" (name, country_code)
|
||||
VALUES
|
||||
('Baden-Württemberg', 'de'),
|
||||
('Bavaria', 'de'),
|
||||
('Berlin', 'de'),
|
||||
('Brandenburg', 'de'),
|
||||
('Bremen', 'de'),
|
||||
('Hamburg', 'de'),
|
||||
('Hesse', 'de'),
|
||||
('Lower Saxony', 'de'),
|
||||
('Mecklenburg-Vorpommern', 'de'),
|
||||
('North Rhine-Westphalia', 'de'),
|
||||
('Rhineland-Palatinate', 'de'),
|
||||
('Saarland', 'de'),
|
||||
('Saxony', 'de'),
|
||||
('Saxony-Anhalt', 'de'),
|
||||
('Schleswig-Holstein', 'de'),
|
||||
('Thuringia', 'de');
|
||||
|
||||
ON CONFLICT (name) DO NOTHING;
|
|
@ -1,82 +1,15 @@
|
|||
INSERT INTO "featuredAdventures" (id, name, location) VALUES
|
||||
(20, 'Yellowstone National Park', 'Wyoming, Montana, Idaho, USA'),
|
||||
(21, 'Yosemite National Park', 'California, USA'),
|
||||
(22, 'Banff National Park', 'Alberta, Canada'),
|
||||
(23, 'Kruger National Park', 'Limpopo, South Africa'),
|
||||
(24, 'Grand Canyon National Park', 'Arizona, USA'),
|
||||
(25, 'Great Smoky Mountains National Park', 'North Carolina, Tennessee, USA'),
|
||||
(26, 'Zion National Park', 'Utah, USA'),
|
||||
(27, 'Glacier National Park', 'Montana, USA'),
|
||||
(28, 'Rocky Mountain National Park', 'Colorado, USA'),
|
||||
(29, 'Everglades National Park', 'Florida, USA'),
|
||||
(30, 'Arches National Park', 'Utah, USA'),
|
||||
(31, 'Acadia National Park', 'Maine, USA'),
|
||||
(32, 'Sequoia National Park', 'California, USA'),
|
||||
(33, 'Joshua Tree National Park', 'California, USA'),
|
||||
(34, 'Yellowstone National Park', 'Wyoming, Montana, Idaho, USA'),
|
||||
(35, 'Bryce Canyon National Park', 'Utah, USA'),
|
||||
(36, 'Grand Teton National Park', 'Wyoming, USA'),
|
||||
(37, 'Denali National Park', 'Alaska, USA'),
|
||||
(38, 'Olympic National Park', 'Washington, USA'),
|
||||
(39, 'Canyonlands National Park', 'Utah, USA'),
|
||||
(40, 'Death Valley National Park', 'California, Nevada, USA'),
|
||||
(41, 'Redwood National and State Parks', 'California, USA'),
|
||||
(42, 'Waterton Lakes National Park', 'Alberta, Canada'),
|
||||
(43, 'Mesa Verde National Park', 'Colorado, USA'),
|
||||
(44, 'Petrified Forest National Park', 'Arizona, USA'),
|
||||
(45, 'Capitol Reef National Park', 'Utah, USA'),
|
||||
(46, 'Yellowstone National Park', 'Wyoming, Montana, Idaho, USA'),
|
||||
(47, 'Yosemite National Park', 'California, USA'),
|
||||
(48, 'Banff National Park', 'Alberta, Canada'),
|
||||
(49, 'Kruger National Park', 'Limpopo, South Africa'),
|
||||
(50, 'Grand Canyon National Park', 'Arizona, USA'),
|
||||
(51, 'Great Smoky Mountains National Park', 'North Carolina, Tennessee, USA'),
|
||||
(52, 'Zion National Park', 'Utah, USA'),
|
||||
(53, 'Glacier National Park', 'Montana, USA'),
|
||||
(54, 'Rocky Mountain National Park', 'Colorado, USA'),
|
||||
(55, 'Everglades National Park', 'Florida, USA'),
|
||||
(56, 'Arches National Park', 'Utah, USA'),
|
||||
(57, 'Acadia National Park', 'Maine, USA'),
|
||||
(58, 'Sequoia National Park', 'California, USA'),
|
||||
(59, 'Joshua Tree National Park', 'California, USA'),
|
||||
(60, 'Yellowstone National Park', 'Wyoming, Montana, Idaho, USA'),
|
||||
(61, 'Bryce Canyon National Park', 'Utah, USA'),
|
||||
(62, 'Grand Teton National Park', 'Wyoming, USA'),
|
||||
(63, 'Denali National Park', 'Alaska, USA'),
|
||||
(64, 'Olympic National Park', 'Washington, USA'),
|
||||
(65, 'Canyonlands National Park', 'Utah, USA'),
|
||||
(66, 'Yellowstone National Park', 'Wyoming, Montana, Idaho, USA'),
|
||||
(67, 'Yosemite National Park', 'California, USA'),
|
||||
(68, 'Banff National Park', 'Alberta, Canada'),
|
||||
(69, 'Kruger National Park', 'Limpopo, South Africa'),
|
||||
(70, 'Grand Canyon National Park', 'Arizona, USA'),
|
||||
(71, 'Great Smoky Mountains National Park', 'North Carolina, Tennessee, USA'),
|
||||
(72, 'Zion National Park', 'Utah, USA'),
|
||||
(73, 'Glacier National Park', 'Montana, USA'),
|
||||
(74, 'Rocky Mountain National Park', 'Colorado, USA'),
|
||||
(75, 'Everglades National Park', 'Florida, USA'),
|
||||
(76, 'Arches National Park', 'Utah, USA'),
|
||||
(77, 'Acadia National Park', 'Maine, USA'),
|
||||
(78, 'Sequoia National Park', 'California, USA'),
|
||||
(79, 'Joshua Tree National Park', 'California, USA'),
|
||||
(80, 'Yellowstone National Park', 'Wyoming, Montana, Idaho, USA'),
|
||||
(81, 'Bryce Canyon National Park', 'Utah, USA'),
|
||||
(82, 'Grand Teton National Park', 'Wyoming, USA'),
|
||||
(83, 'Denali National Park', 'Alaska, USA'),
|
||||
(84, 'Olympic National Park', 'Washington, USA'),
|
||||
(85, 'Canyonlands National Park', 'Utah, USA'),
|
||||
(86, 'Yellowstone National Park', 'Wyoming, Montana, Idaho, USA'),
|
||||
(87, 'Yosemite National Park', 'California, USA'),
|
||||
(88, 'Banff National Park', 'Alberta, Canada'),
|
||||
(89, 'Kruger National Park', 'Limpopo, South Africa'),
|
||||
(90, 'Grand Canyon National Park', 'Arizona, USA'),
|
||||
(91, 'Great Smoky Mountains National Park', 'North Carolina, Tennessee, USA'),
|
||||
(92, 'Zion National Park', 'Utah, USA'),
|
||||
(93, 'Glacier National Park', 'Montana, USA'),
|
||||
(94, 'Rocky Mountain National Park', 'Colorado, USA'),
|
||||
(95, 'Everglades National Park', 'Florida, USA'),
|
||||
(96, 'Arches National Park', 'Utah, USA'),
|
||||
(97, 'Acadia National Park', 'Maine, USA'),
|
||||
(98, 'Sequoia National Park', 'California, USA'),
|
||||
(99, 'Joshua Tree National Park', 'California, USA');
|
||||
ON CONFLICT (id) DO NOTHING;
|
||||
INSERT INTO "featuredAdventures" (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;
|
54
sql/us.sql
Normal file
54
sql/us.sql
Normal file
|
@ -0,0 +1,54 @@
|
|||
INSERT INTO "worldTravelCountryRegions" (name, country_code)
|
||||
VALUES
|
||||
('Alabama', 'us'),
|
||||
('Alaska', 'us'),
|
||||
('Arizona', 'us'),
|
||||
('Arkansas', 'us'),
|
||||
('California', 'us'),
|
||||
('Colorado', 'us'),
|
||||
('Connecticut', 'us'),
|
||||
('Delaware', 'us'),
|
||||
('Florida', 'us'),
|
||||
('Georgia', 'us'),
|
||||
('Hawaii', 'us'),
|
||||
('Idaho', 'us'),
|
||||
('Illinois', 'us'),
|
||||
('Indiana', 'us'),
|
||||
('Iowa', 'us'),
|
||||
('Kansas', 'us'),
|
||||
('Kentucky', 'us'),
|
||||
('Louisiana', 'us'),
|
||||
('Maine', 'us'),
|
||||
('Maryland', 'us'),
|
||||
('Massachusetts', 'us'),
|
||||
('Michigan', 'us'),
|
||||
('Minnesota', 'us'),
|
||||
('Mississippi', 'us'),
|
||||
('Missouri', 'us'),
|
||||
('Montana', 'us'),
|
||||
('Nebraska', 'us'),
|
||||
('Nevada', 'us'),
|
||||
('New Hampshire', 'us'),
|
||||
('New Jersey', 'us'),
|
||||
('New Mexico', 'us'),
|
||||
('New York', 'us'),
|
||||
('North Carolina', 'us'),
|
||||
('North Dakota', 'us'),
|
||||
('Ohio', 'us'),
|
||||
('Oklahoma', 'us'),
|
||||
('Oregon', 'us'),
|
||||
('Pennsylvania', 'us'),
|
||||
('Rhode Island', 'us'),
|
||||
('South Carolina', 'us'),
|
||||
('South Dakota', 'us'),
|
||||
('Tennessee', 'us'),
|
||||
('Texas', 'us'),
|
||||
('Utah', 'us'),
|
||||
('Vermont', 'us'),
|
||||
('Virginia', 'us'),
|
||||
('Washington', 'us'),
|
||||
('West Virginia', 'us'),
|
||||
('Wisconsin', 'us'),
|
||||
('Wyoming', 'us');
|
||||
|
||||
ON CONFLICT (name) DO NOTHING;
|
|
@ -11,7 +11,7 @@ import {
|
|||
|
||||
export const featuredAdventures = pgTable("featuredAdventures", {
|
||||
id: serial("id").primaryKey(),
|
||||
name: text("name").notNull(),
|
||||
name: text("name").notNull().unique(),
|
||||
location: text("location"),
|
||||
});
|
||||
|
||||
|
@ -63,7 +63,7 @@ export const worldTravelCountries = pgTable("worldTravelCountries", {
|
|||
|
||||
export const worldTravelCountryRegions = pgTable("worldTravelCountryRegions", {
|
||||
id: serial("id").primaryKey(),
|
||||
name: text("name").notNull(),
|
||||
name: text("name").notNull().unique(),
|
||||
country_code: text("country_code")
|
||||
.notNull()
|
||||
.references(() => worldTravelCountries.country_code),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue