diff --git a/migrations/0004_noisy_squadron_supreme.sql b/migrations/0004_noisy_squadron_supreme.sql new file mode 100644 index 0000000..73b4715 --- /dev/null +++ b/migrations/0004_noisy_squadron_supreme.sql @@ -0,0 +1,13 @@ +CREATE TABLE IF NOT EXISTS "userPlannedAdventures" ( + "id" serial PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "adventure_name" text NOT NULL, + "location" text, + "activity_types" text +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "userPlannedAdventures" ADD CONSTRAINT "userPlannedAdventures_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_massive_black_tarantula.sql b/migrations/0005_massive_black_tarantula.sql new file mode 100644 index 0000000..8bd5e95 --- /dev/null +++ b/migrations/0005_massive_black_tarantula.sql @@ -0,0 +1 @@ +ALTER TABLE "userPlannedAdventures" ALTER COLUMN "activity_types" SET DATA TYPE json; \ No newline at end of file diff --git a/migrations/0006_colorful_inertia.sql b/migrations/0006_colorful_inertia.sql new file mode 100644 index 0000000..dab5474 --- /dev/null +++ b/migrations/0006_colorful_inertia.sql @@ -0,0 +1,10 @@ +ALTER TABLE "userPlannedAdventures" RENAME COLUMN "user_id" TO "userId";--> statement-breakpoint +ALTER TABLE "userPlannedAdventures" RENAME COLUMN "adventure_name" TO "adventureName";--> statement-breakpoint +ALTER TABLE "userPlannedAdventures" RENAME COLUMN "activity_types" TO "activityTypes";--> statement-breakpoint +ALTER TABLE "userPlannedAdventures" DROP CONSTRAINT "userPlannedAdventures_user_id_user_id_fk"; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "userPlannedAdventures" ADD CONSTRAINT "userPlannedAdventures_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; diff --git a/migrations/meta/0004_snapshot.json b/migrations/meta/0004_snapshot.json new file mode 100644 index 0000000..a3cad2e --- /dev/null +++ b/migrations/meta/0004_snapshot.json @@ -0,0 +1,463 @@ +{ + "id": "4ed4f0d5-7731-49a1-ab2f-9af3aad2c95c", + "prevId": "72cc9a9a-a12e-4ca2-b644-b704673af4d7", + "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": {} + }, + "userPlannedAdventures": { + "name": "userPlannedAdventures", + "schema": "", + "columns": { + "id": { + "name": "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 + }, + "activity_types": { + "name": "activity_types", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "userPlannedAdventures_user_id_user_id_fk": { + "name": "userPlannedAdventures_user_id_user_id_fk", + "tableFrom": "userPlannedAdventures", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "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": {} + } +} \ No newline at end of file diff --git a/migrations/meta/0005_snapshot.json b/migrations/meta/0005_snapshot.json new file mode 100644 index 0000000..8b41890 --- /dev/null +++ b/migrations/meta/0005_snapshot.json @@ -0,0 +1,463 @@ +{ + "id": "f3c33262-0fe7-4b0f-8522-82e337da26d5", + "prevId": "4ed4f0d5-7731-49a1-ab2f-9af3aad2c95c", + "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": {} + }, + "userPlannedAdventures": { + "name": "userPlannedAdventures", + "schema": "", + "columns": { + "id": { + "name": "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 + }, + "activity_types": { + "name": "activity_types", + "type": "json", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "userPlannedAdventures_user_id_user_id_fk": { + "name": "userPlannedAdventures_user_id_user_id_fk", + "tableFrom": "userPlannedAdventures", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "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": {} + } +} \ No newline at end of file diff --git a/migrations/meta/0006_snapshot.json b/migrations/meta/0006_snapshot.json new file mode 100644 index 0000000..b5672e8 --- /dev/null +++ b/migrations/meta/0006_snapshot.json @@ -0,0 +1,463 @@ +{ + "id": "42010132-1400-4431-800b-7ecd45c7aa9a", + "prevId": "f3c33262-0fe7-4b0f-8522-82e337da26d5", + "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": {} + }, + "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 + } + }, + "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": {} + } +} \ No newline at end of file diff --git a/migrations/meta/_journal.json b/migrations/meta/_journal.json index a1f987e..c185a1f 100644 --- a/migrations/meta/_journal.json +++ b/migrations/meta/_journal.json @@ -29,6 +29,27 @@ "when": 1713402092365, "tag": "0003_easy_iron_monger", "breakpoints": true + }, + { + "idx": 4, + "version": "5", + "when": 1713737819317, + "tag": "0004_noisy_squadron_supreme", + "breakpoints": true + }, + { + "idx": 5, + "version": "5", + "when": 1713738940329, + "tag": "0005_massive_black_tarantula", + "breakpoints": true + }, + { + "idx": 6, + "version": "5", + "when": 1713739045755, + "tag": "0006_colorful_inertia", + "breakpoints": true } ] } \ No newline at end of file diff --git a/src/lib/components/AdventureCard.svelte b/src/lib/components/AdventureCard.svelte index 79684f2..6548f3b 100644 --- a/src/lib/components/AdventureCard.svelte +++ b/src/lib/components/AdventureCard.svelte @@ -14,6 +14,7 @@ export let regionId: String | undefined = undefined; export let visited: Boolean | undefined = undefined; export let countryCode: String | undefined = undefined; + export let activityTypes: String[] | undefined = undefined; function remove() { dispatch("remove", id); @@ -126,3 +127,25 @@ {/if} + +{#if type === "planner"} +
{location}
+{activityTypes}
+ {/if} +