diff --git a/Dockerfile b/Dockerfile index 97eb7d7..a9d97fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,8 @@ FROM node:18-alpine AS external-website # A small line inside the image to show who made it LABEL Developers="Sean Morley" +RUN apk update && apk add postgresql-client + # The WORKDIR instruction sets the working directory for everything that will happen next WORKDIR /app diff --git a/docker-compose.yml b/docker-compose.yml index a050d04..4a58128 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: web: - image: ghcr.io/seanmorley15/adventurelog:latest + build: . ports: - "3000:3000" environment: @@ -9,6 +9,8 @@ services: - ORIGIN=http://localhost:3000 depends_on: - db + volumes: + - ./sql:/sql db: image: postgres environment: diff --git a/migrations/0000_fancy_starjammers.sql b/migrations/0000_fancy_starjammers.sql deleted file mode 100644 index 2f2d3b5..0000000 --- a/migrations/0000_fancy_starjammers.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE IF NOT EXISTS "featuredAdventures" ( - "id" serial PRIMARY KEY NOT NULL, - "name" text NOT NULL, - "location" text -); diff --git a/migrations/0000_hard_mach_iv.sql b/migrations/0000_hard_mach_iv.sql new file mode 100644 index 0000000..5c9c0d1 --- /dev/null +++ b/migrations/0000_hard_mach_iv.sql @@ -0,0 +1,86 @@ +CREATE TABLE IF NOT EXISTS "featuredAdventures" ( + "id" serial PRIMARY KEY NOT NULL, + "name" text NOT NULL, + "location" text, + CONSTRAINT "featuredAdventures_name_unique" UNIQUE("name") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "session" ( + "id" text PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "expires_at" timestamp with time zone NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "sharedAdventures" ( + "id" text PRIMARY KEY NOT NULL, + "data" json NOT NULL, + "name" text NOT NULL, + "date" text NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "user" ( + "id" text PRIMARY KEY NOT NULL, + "username" text NOT NULL, + "first_name" text NOT NULL, + "last_name" text NOT NULL, + "icon" text, + "hashed_password" varchar NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "userVisitedAdventures" ( + "adventure_id" serial PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "adventure_name" text NOT NULL, + "location" text, + "visited_date" text +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "userVisitedWorldTravel" ( + "id" serial PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "region_id" varchar NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "worldTravelCountries" ( + "id" serial PRIMARY KEY NOT NULL, + "name" text NOT NULL, + "country_code" text NOT NULL, + "continent" text NOT NULL, + CONSTRAINT "worldTravelCountries_country_code_unique" UNIQUE("country_code") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "worldTravelCountryRegions" ( + "id" varchar PRIMARY KEY NOT NULL, + "name" text NOT NULL, + "country_code" text NOT NULL +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "userVisitedAdventures" ADD CONSTRAINT "userVisitedAdventures_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "userVisitedWorldTravel" ADD CONSTRAINT "userVisitedWorldTravel_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "userVisitedWorldTravel" ADD CONSTRAINT "userVisitedWorldTravel_region_id_worldTravelCountryRegions_id_fk" FOREIGN KEY ("region_id") REFERENCES "worldTravelCountryRegions"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "worldTravelCountryRegions" ADD CONSTRAINT "worldTravelCountryRegions_country_code_worldTravelCountries_country_code_fk" FOREIGN KEY ("country_code") REFERENCES "worldTravelCountries"("country_code") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; diff --git a/migrations/0001_nostalgic_skreet.sql b/migrations/0001_nostalgic_skreet.sql deleted file mode 100644 index cf21484..0000000 --- a/migrations/0001_nostalgic_skreet.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE IF NOT EXISTS "sharedAdventures" ( - "id" serial PRIMARY KEY NOT NULL, - "name" text NOT NULL, - "location" text, - "date" text -); diff --git a/migrations/0002_dusty_captain_midlands.sql b/migrations/0002_dusty_captain_midlands.sql deleted file mode 100644 index 5945004..0000000 --- a/migrations/0002_dusty_captain_midlands.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "sharedAdventures" ALTER COLUMN "id" SET DATA TYPE text; \ No newline at end of file diff --git a/migrations/0003_clammy_goblin_queen.sql b/migrations/0003_clammy_goblin_queen.sql deleted file mode 100644 index ada8daf..0000000 --- a/migrations/0003_clammy_goblin_queen.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE "sharedAdventures" ADD COLUMN "data" json NOT NULL;--> statement-breakpoint -ALTER TABLE "sharedAdventures" DROP COLUMN IF EXISTS "name";--> statement-breakpoint -ALTER TABLE "sharedAdventures" DROP COLUMN IF EXISTS "location";--> statement-breakpoint -ALTER TABLE "sharedAdventures" DROP COLUMN IF EXISTS "date"; \ No newline at end of file diff --git a/migrations/0004_smart_maelstrom.sql b/migrations/0004_smart_maelstrom.sql deleted file mode 100644 index 5982edc..0000000 --- a/migrations/0004_smart_maelstrom.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE IF NOT EXISTS "session" ( - "id" text PRIMARY KEY NOT NULL, - "user_id" text NOT NULL, - "expires_at" timestamp with time zone NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "user" ( - "id" text PRIMARY KEY NOT NULL -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/migrations/0005_glamorous_pixie.sql b/migrations/0005_glamorous_pixie.sql deleted file mode 100644 index c50335d..0000000 --- a/migrations/0005_glamorous_pixie.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "user" ADD COLUMN "username" text NOT NULL;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "hashed_password" text NOT NULL; \ No newline at end of file diff --git a/migrations/0006_melted_leech.sql b/migrations/0006_melted_leech.sql deleted file mode 100644 index 202d31b..0000000 --- a/migrations/0006_melted_leech.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "user" ALTER COLUMN "hashed_password" SET DATA TYPE varchar; \ No newline at end of file diff --git a/migrations/0007_nervous_scalphunter.sql b/migrations/0007_nervous_scalphunter.sql deleted file mode 100644 index baf412d..0000000 --- a/migrations/0007_nervous_scalphunter.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "user" ADD COLUMN "first_name" text NOT NULL;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "last_name" text NOT NULL; \ No newline at end of file diff --git a/migrations/0008_romantic_maria_hill.sql b/migrations/0008_romantic_maria_hill.sql deleted file mode 100644 index da68456..0000000 --- a/migrations/0008_romantic_maria_hill.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS "userVisitedAdventures" ( - "user_id" text NOT NULL, - "adventure_name" text NOT NULL, - "location" text, - "adventure_visited" text -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "userVisitedAdventures" ADD CONSTRAINT "userVisitedAdventures_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/migrations/0009_spotty_madame_web.sql b/migrations/0009_spotty_madame_web.sql deleted file mode 100644 index 900b8d7..0000000 --- a/migrations/0009_spotty_madame_web.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE "userVisitedAdventures" RENAME COLUMN "adventure_visited" TO "adventure_id";--> statement-breakpoint -ALTER TABLE "userVisitedAdventures" ADD PRIMARY KEY ("adventure_id");--> statement-breakpoint -ALTER TABLE "userVisitedAdventures" ALTER COLUMN "adventure_id" SET DATA TYPE serial;--> statement-breakpoint -ALTER TABLE "userVisitedAdventures" ALTER COLUMN "adventure_id" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "userVisitedAdventures" ADD COLUMN "visited_date" text; \ No newline at end of file diff --git a/migrations/0010_lean_gamma_corps.sql b/migrations/0010_lean_gamma_corps.sql deleted file mode 100644 index 81eb4e1..0000000 --- a/migrations/0010_lean_gamma_corps.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "user" ADD COLUMN "icon" text; \ No newline at end of file diff --git a/migrations/meta/0000_snapshot.json b/migrations/meta/0000_snapshot.json index 5700d27..f038117 100644 --- a/migrations/meta/0000_snapshot.json +++ b/migrations/meta/0000_snapshot.json @@ -1,5 +1,5 @@ { - "id": "1639b320-88dd-4af5-ae34-092ab26b4b85", + "id": "b6ab23b7-42f0-4475-aa5d-23b92c00e97f", "prevId": "00000000-0000-0000-0000-000000000000", "version": "5", "dialect": "pg", @@ -30,6 +30,329 @@ "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": {} + }, + "userVisitedWorldTravel": { + "name": "userVisitedWorldTravel", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "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_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 + } + }, + "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": {} } }, diff --git a/migrations/meta/0001_snapshot.json b/migrations/meta/0001_snapshot.json deleted file mode 100644 index bbdf8d5..0000000 --- a/migrations/meta/0001_snapshot.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "id": "183ebfda-8d83-4256-8715-169d36867deb", - "prevId": "1639b320-88dd-4af5-ae34-092ab26b4b85", - "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": {} - }, - "sharedAdventures": { - "name": "sharedAdventures", - "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 - }, - "date": { - "name": "date", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0002_snapshot.json b/migrations/meta/0002_snapshot.json deleted file mode 100644 index 7be23f6..0000000 --- a/migrations/meta/0002_snapshot.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "id": "808d6d31-5ef6-4b22-97f0-cfc73193eb5e", - "prevId": "183ebfda-8d83-4256-8715-169d36867deb", - "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": {} - }, - "sharedAdventures": { - "name": "sharedAdventures", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location": { - "name": "location", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "date": { - "name": "date", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0003_snapshot.json b/migrations/meta/0003_snapshot.json deleted file mode 100644 index f8fd8c1..0000000 --- a/migrations/meta/0003_snapshot.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "id": "45d98527-f0a9-44fc-9658-d3c461afed95", - "prevId": "808d6d31-5ef6-4b22-97f0-cfc73193eb5e", - "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": {} - }, - "sharedAdventures": { - "name": "sharedAdventures", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0004_snapshot.json b/migrations/meta/0004_snapshot.json deleted file mode 100644 index 9d59b97..0000000 --- a/migrations/meta/0004_snapshot.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "id": "ccf7c336-c61f-452f-822b-b3b039bb20f9", - "prevId": "45d98527-f0a9-44fc-9658-d3c461afed95", - "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": {} - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0005_snapshot.json b/migrations/meta/0005_snapshot.json deleted file mode 100644 index 116f836..0000000 --- a/migrations/meta/0005_snapshot.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "id": "e91dda33-e04e-4e99-a297-21a34aa35493", - "prevId": "ccf7c336-c61f-452f-822b-b3b039bb20f9", - "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": {} - }, - "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 - } - }, - "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 - }, - "hashed_password": { - "name": "hashed_password", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0006_snapshot.json b/migrations/meta/0006_snapshot.json deleted file mode 100644 index 2b36a76..0000000 --- a/migrations/meta/0006_snapshot.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "id": "b0849b3e-02e1-42e1-b07c-6fa613c98e82", - "prevId": "e91dda33-e04e-4e99-a297-21a34aa35493", - "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": {} - }, - "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 - } - }, - "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 - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0007_snapshot.json b/migrations/meta/0007_snapshot.json deleted file mode 100644 index e436475..0000000 --- a/migrations/meta/0007_snapshot.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "id": "2039600b-1f5f-4f37-84dd-bb40636855e7", - "prevId": "b0849b3e-02e1-42e1-b07c-6fa613c98e82", - "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": {} - }, - "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 - } - }, - "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 - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0008_snapshot.json b/migrations/meta/0008_snapshot.json deleted file mode 100644 index 1580c9e..0000000 --- a/migrations/meta/0008_snapshot.json +++ /dev/null @@ -1,195 +0,0 @@ -{ - "id": "ec5af5e4-8522-4383-af47-412fb43c7cc3", - "prevId": "2039600b-1f5f-4f37-84dd-bb40636855e7", - "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": {} - }, - "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 - } - }, - "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 - }, - "hashed_password": { - "name": "hashed_password", - "type": "varchar", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "userVisitedAdventures": { - "name": "userVisitedAdventures", - "schema": "", - "columns": { - "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 - }, - "adventure_visited": { - "name": "adventure_visited", - "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": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0009_snapshot.json b/migrations/meta/0009_snapshot.json deleted file mode 100644 index 46e2615..0000000 --- a/migrations/meta/0009_snapshot.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "id": "1d83805d-6ee2-4dae-87a6-5af6f2d5add3", - "prevId": "ec5af5e4-8522-4383-af47-412fb43c7cc3", - "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": {} - }, - "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 - } - }, - "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 - }, - "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": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0010_snapshot.json b/migrations/meta/0010_snapshot.json deleted file mode 100644 index a5a5fdd..0000000 --- a/migrations/meta/0010_snapshot.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "id": "d6cd08c8-9dc8-42df-aab9-0f5800602864", - "prevId": "1d83805d-6ee2-4dae-87a6-5af6f2d5add3", - "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": {} - }, - "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 - } - }, - "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": {} - } - }, - "enums": {}, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/_journal.json b/migrations/meta/_journal.json index 3f770a8..ce56d99 100644 --- a/migrations/meta/_journal.json +++ b/migrations/meta/_journal.json @@ -5,78 +5,8 @@ { "idx": 0, "version": "5", - "when": 1712061709595, - "tag": "0000_fancy_starjammers", - "breakpoints": true - }, - { - "idx": 1, - "version": "5", - "when": 1712083579596, - "tag": "0001_nostalgic_skreet", - "breakpoints": true - }, - { - "idx": 2, - "version": "5", - "when": 1712083756923, - "tag": "0002_dusty_captain_midlands", - "breakpoints": true - }, - { - "idx": 3, - "version": "5", - "when": 1712083977580, - "tag": "0003_clammy_goblin_queen", - "breakpoints": true - }, - { - "idx": 4, - "version": "5", - "when": 1712103855532, - "tag": "0004_smart_maelstrom", - "breakpoints": true - }, - { - "idx": 5, - "version": "5", - "when": 1712104331399, - "tag": "0005_glamorous_pixie", - "breakpoints": true - }, - { - "idx": 6, - "version": "5", - "when": 1712105206127, - "tag": "0006_melted_leech", - "breakpoints": true - }, - { - "idx": 7, - "version": "5", - "when": 1712167204757, - "tag": "0007_nervous_scalphunter", - "breakpoints": true - }, - { - "idx": 8, - "version": "5", - "when": 1712186591227, - "tag": "0008_romantic_maria_hill", - "breakpoints": true - }, - { - "idx": 9, - "version": "5", - "when": 1712407140727, - "tag": "0009_spotty_madame_web", - "breakpoints": true - }, - { - "idx": 10, - "version": "5", - "when": 1712842196443, - "tag": "0010_lean_gamma_corps", + "when": 1713037717607, + "tag": "0000_hard_mach_iv", "breakpoints": true } ] diff --git a/sampleData/parks.sql b/sampleData/parks.sql deleted file mode 100644 index 207813c..0000000 --- a/sampleData/parks.sql +++ /dev/null @@ -1,81 +0,0 @@ -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'); diff --git a/sql/001_countries.sql b/sql/001_countries.sql new file mode 100644 index 0000000..0608443 --- /dev/null +++ b/sql/001_countries.sql @@ -0,0 +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; \ No newline at end of file diff --git a/sql/002_us.sql b/sql/002_us.sql new file mode 100644 index 0000000..aef770c --- /dev/null +++ b/sql/002_us.sql @@ -0,0 +1,53 @@ +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; diff --git a/sql/003_ca.sql b/sql/003_ca.sql new file mode 100644 index 0000000..14c777d --- /dev/null +++ b/sql/003_ca.sql @@ -0,0 +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; diff --git a/sql/004_de.sql b/sql/004_de.sql new file mode 100644 index 0000000..a8be86c --- /dev/null +++ b/sql/004_de.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/005_fr.sql b/sql/005_fr.sql new file mode 100644 index 0000000..08cabf5 --- /dev/null +++ b/sql/005_fr.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/006_gb.sql b/sql/006_gb.sql new file mode 100644 index 0000000..c1a0ef9 --- /dev/null +++ b/sql/006_gb.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/007_ar.sql b/sql/007_ar.sql new file mode 100644 index 0000000..627335d --- /dev/null +++ b/sql/007_ar.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/008_mx.sql b/sql/008_mx.sql new file mode 100644 index 0000000..4f57691 --- /dev/null +++ b/sql/008_mx.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/009_jp.sql b/sql/009_jp.sql new file mode 100644 index 0000000..dda90b9 --- /dev/null +++ b/sql/009_jp.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/010_cn.sql b/sql/010_cn.sql new file mode 100644 index 0000000..c7353ae --- /dev/null +++ b/sql/010_cn.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/011_in.sql b/sql/011_in.sql new file mode 100644 index 0000000..45c76b6 --- /dev/null +++ b/sql/011_in.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/012_au.sql b/sql/012_au.sql new file mode 100644 index 0000000..8882314 --- /dev/null +++ b/sql/012_au.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/013_nz.sql b/sql/013_nz.sql new file mode 100644 index 0000000..9d20865 --- /dev/null +++ b/sql/013_nz.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/014_za.sql b/sql/014_za.sql new file mode 100644 index 0000000..44b493c --- /dev/null +++ b/sql/014_za.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/015_eg.sql b/sql/015_eg.sql new file mode 100644 index 0000000..21c5e66 --- /dev/null +++ b/sql/015_eg.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/016_br.sql b/sql/016_br.sql new file mode 100644 index 0000000..6bbbd2b --- /dev/null +++ b/sql/016_br.sql @@ -0,0 +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') + +ON CONFLICT (id) DO NOTHING; diff --git a/sql/parks.sql b/sql/parks.sql new file mode 100644 index 0000000..b8697f4 --- /dev/null +++ b/sql/parks.sql @@ -0,0 +1,15 @@ +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; \ No newline at end of file diff --git a/src/lib/components/AdventureCard.svelte b/src/lib/components/AdventureCard.svelte index 01e296a..c88d253 100644 --- a/src/lib/components/AdventureCard.svelte +++ b/src/lib/components/AdventureCard.svelte @@ -6,10 +6,12 @@ export let type: String; - export let name: String; - export let location: String; - export let created: string; - export let id: Number; + export let name: String | undefined = undefined; + export let location: String | undefined = undefined; + export let created: String | undefined = undefined; + export let id: Number | undefined = undefined; + export let regionId: String | undefined = undefined; + export let visited: Boolean | undefined = undefined; function remove() { dispatch("remove", id); @@ -20,6 +22,14 @@ function add() { dispatch("add", { name, location }); } + function markVisited() { + dispatch("markVisited", regionId); + visited = true; + } + function removeVisit() { + dispatch("removeVisit", regionId); + visited = false; + } {#if type === "mylog"} @@ -75,3 +85,52 @@ {/if} + +{#if type === "shared"} +
+ {location}
+
+ {created}
+
{regionId}
+Made with ❤️ in Connecticut.
+Made with ❤️ in the United States.