From e95b7da1e39f3ef4735687260fd5f7554d38b8ee Mon Sep 17 00:00:00 2001 From: Stan Runge Date: Sat, 24 Oct 2026 15:38:30 +0000 Subject: [PATCH] cars: car pokedex tracker (brands, models, US variants from RDW + fueleconomy.gov), import script, search/filter UI, model pages --- drizzle.config.ts | 3 +- drizzle/20261024153902_cars/migration.sql | 134 + drizzle/20261024153902_cars/snapshot.json | 18350 ++++++++++++++++ package.json | 1 + scripts/cars-import.ts | 1055 + src/lib/cars/BrandBadge.svelte | 43 + src/lib/cars/CarCard.svelte | 125 + src/lib/cars/FuelChip.svelte | 63 + src/lib/cars/shared.ts | 167 + src/lib/projects.test.ts | 4 +- src/lib/projects.ts | 7 + src/lib/seo.ts | 5 + src/lib/server/cars.ts | 198 + src/lib/server/db/schema/cars.ts | 137 + src/lib/server/db/schema/index.ts | 1 + src/lib/server/db/schema/schemas.ts | 1 + src/lib/server/owner.test.ts | 2 + src/lib/server/owner.ts | 3 +- src/lib/title.ts | 1 + src/routes/sitemap.xml/+server.ts | 1 + src/routes/trackers/cars/+page.server.ts | 20 + src/routes/trackers/cars/+page.svelte | 325 + .../trackers/cars/[brand]/+page.server.ts | 27 + src/routes/trackers/cars/[brand]/+page.svelte | 53 + .../cars/[brand]/[model]/+page.server.ts | 46 + .../cars/[brand]/[model]/+page.svelte | 576 + src/routes/trackers/cars/random/+server.ts | 9 + 27 files changed, 21353 insertions(+), 4 deletions(-) create mode 100644 drizzle/20261024153902_cars/migration.sql create mode 100644 drizzle/20261024153902_cars/snapshot.json create mode 100644 scripts/cars-import.ts create mode 100644 src/lib/cars/BrandBadge.svelte create mode 100644 src/lib/cars/CarCard.svelte create mode 100644 src/lib/cars/FuelChip.svelte create mode 100644 src/lib/cars/shared.ts create mode 100644 src/lib/server/cars.ts create mode 100644 src/lib/server/db/schema/cars.ts create mode 100644 src/routes/trackers/cars/+page.server.ts create mode 100644 src/routes/trackers/cars/+page.svelte create mode 100644 src/routes/trackers/cars/[brand]/+page.server.ts create mode 100644 src/routes/trackers/cars/[brand]/+page.svelte create mode 100644 src/routes/trackers/cars/[brand]/[model]/+page.server.ts create mode 100644 src/routes/trackers/cars/[brand]/[model]/+page.svelte create mode 100644 src/routes/trackers/cars/random/+server.ts diff --git a/drizzle.config.ts b/drizzle.config.ts index 10950a1..fd2815a 100755 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -24,7 +24,8 @@ export default defineConfig({ 'books', 'tasks', 'groceries', - 'home' + 'home', + 'cars' ], migrations: { schema: 'drizzle', table: '__drizzle_migrations' }, verbose: true, diff --git a/drizzle/20261024153902_cars/migration.sql b/drizzle/20261024153902_cars/migration.sql new file mode 100644 index 0000000..a75b2d1 --- /dev/null +++ b/drizzle/20261024153902_cars/migration.sql @@ -0,0 +1,134 @@ +CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public; +--> statement-breakpoint +CREATE SCHEMA "cars"; +--> statement-breakpoint +CREATE TABLE "cars"."brands" ( + "id" serial PRIMARY KEY, + "slug" text NOT NULL, + "name" text NOT NULL, + "country" text, + "model_count" integer DEFAULT 0 NOT NULL, + "nl_count" integer DEFAULT 0 NOT NULL, + "first_year" smallint, + "last_year" smallint, + "sources" text[] DEFAULT '{}'::text[] NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "cars"."models" ( + "id" serial PRIMARY KEY, + "dex" integer NOT NULL, + "brand_id" integer NOT NULL, + "slug" text NOT NULL, + "name" text NOT NULL, + "search" text NOT NULL, + "first_year" smallint, + "last_year" smallint, + "bodies" text[] DEFAULT '{}'::text[] NOT NULL, + "size_classes" text[] DEFAULT '{}'::text[] NOT NULL, + "fuels" text[] DEFAULT '{}'::text[] NOT NULL, + "drives" text[] DEFAULT '{}'::text[] NOT NULL, + "transmissions" text[] DEFAULT '{}'::text[] NOT NULL, + "engine_l_min" real, + "engine_l_max" real, + "cylinders_min" smallint, + "cylinders_max" smallint, + "turbo" boolean, + "power_kw_min" real, + "power_kw_max" real, + "l100_min" real, + "l100_max" real, + "co2_min" smallint, + "co2_max" smallint, + "mpg_min" real, + "mpg_max" real, + "range_km_max" smallint, + "seats" smallint, + "doors" smallint, + "mass_kg" smallint, + "nl_count" integer DEFAULT 0 NOT NULL, + "nl_rank" integer, + "nl_first_year" smallint, + "nl_last_year" smallint, + "nl_price" integer, + "nl_price_latest" integer, + "nl_price_latest_year" smallint, + "nl_years" jsonb DEFAULT '[]' NOT NULL, + "nl_names" jsonb DEFAULT '[]' NOT NULL, + "us_years" smallint[] DEFAULT '{}'::smallint[] NOT NULL, + "variant_count" integer DEFAULT 0 NOT NULL, + "sources" text[] DEFAULT '{}'::text[] NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +CREATE TABLE "cars"."variants" ( + "id" serial PRIMARY KEY, + "model_id" integer NOT NULL, + "source" text DEFAULT 'fueleconomy.gov' NOT NULL, + "source_id" integer, + "year" smallint NOT NULL, + "name" text NOT NULL, + "engine_l" real, + "cylinders" smallint, + "transmission" text, + "drive" text, + "fuel" text, + "size_class" text, + "mpg_city" real, + "mpg_hwy" real, + "mpg_comb" real, + "co2_gpm" smallint, + "range_mi" smallint, + "ev_motor" text, + "turbo" boolean DEFAULT false NOT NULL, + "supercharged" boolean DEFAULT false NOT NULL +); +--> statement-breakpoint +CREATE UNIQUE INDEX "brands_slug_key" ON "cars"."brands" ("slug");--> statement-breakpoint +CREATE UNIQUE INDEX "models_dex_key" ON "cars"."models" ("dex");--> statement-breakpoint +CREATE UNIQUE INDEX "models_brand_slug_key" ON "cars"."models" ("brand_id","slug");--> statement-breakpoint +CREATE INDEX "models_nl_count_idx" ON "cars"."models" ("nl_count");--> statement-breakpoint +CREATE INDEX "models_search_trgm_idx" ON "cars"."models" USING gin ("search" public.gin_trgm_ops);--> statement-breakpoint +CREATE INDEX "variants_model_year_idx" ON "cars"."variants" ("model_id","year");--> statement-breakpoint +ALTER TABLE "cars"."models" ADD CONSTRAINT "models_brand_id_brands_id_fkey" FOREIGN KEY ("brand_id") REFERENCES "cars"."brands"("id") ON DELETE CASCADE;--> statement-breakpoint +ALTER TABLE "cars"."variants" ADD CONSTRAINT "variants_model_id_models_id_fkey" FOREIGN KEY ("model_id") REFERENCES "cars"."models"("id") ON DELETE CASCADE; +--> statement-breakpoint +-- Hand-written: updated_at triggers, grants, GUI registration. Data comes from scripts/cars-import.ts. +DO $$ +DECLARE t text; +BEGIN + FOREACH t IN ARRAY ARRAY['brands','models'] LOOP + EXECUTE format('CREATE TRIGGER touch_updated_at BEFORE UPDATE ON cars.%I FOR EACH ROW EXECUTE FUNCTION meta.touch_updated_at()', t); + END LOOP; +END $$; +--> statement-breakpoint +DO $$ +BEGIN + IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'personal_app') THEN + GRANT USAGE ON SCHEMA cars TO personal_app; + GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA cars TO personal_app; + GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA cars TO personal_app; + ALTER DEFAULT PRIVILEGES IN SCHEMA cars GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO personal_app; + ALTER DEFAULT PRIVILEGES IN SCHEMA cars GRANT USAGE, SELECT ON SEQUENCES TO personal_app; + END IF; + IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'personal_ro') THEN + GRANT USAGE ON SCHEMA cars TO personal_ro; + GRANT SELECT ON ALL TABLES IN SCHEMA cars TO personal_ro; + ALTER DEFAULT PRIVILEGES IN SCHEMA cars GRANT SELECT ON TABLES TO personal_ro; + END IF; +END $$; +--> statement-breakpoint +DO $$ +BEGIN + IF to_regclass('meta.tables') IS NOT NULL THEN + INSERT INTO meta.tables (schema_name, table_name, slug, display_name, kind, editable, has_done, sort_order) + VALUES ('cars','brands','cars-brands','Car brands','core',false,false,1000), + ('cars','models','cars-models','Car models','core',false,false,1000) + ON CONFLICT DO NOTHING; + IF has_function_privilege('meta.sync(integer)', 'EXECUTE') THEN + PERFORM meta.sync(); + END IF; + END IF; +END $$; diff --git a/drizzle/20261024153902_cars/snapshot.json b/drizzle/20261024153902_cars/snapshot.json new file mode 100644 index 0000000..02e9817 --- /dev/null +++ b/drizzle/20261024153902_cars/snapshot.json @@ -0,0 +1,18350 @@ +{ + "version": "8", + "dialect": "postgres", + "id": "f73cb28d-dc5e-460d-9223-cdddf0d255ec", + "prevIds": [ + "9bb99f1d-442a-4f3b-abcd-c4b6bcd268ea" + ], + "ddl": [ + { + "name": "animaldex", + "entityType": "schemas" + }, + { + "name": "auth", + "entityType": "schemas" + }, + { + "name": "books", + "entityType": "schemas" + }, + { + "name": "cars", + "entityType": "schemas" + }, + { + "name": "cs", + "entityType": "schemas" + }, + { + "name": "games", + "entityType": "schemas" + }, + { + "name": "groceries", + "entityType": "schemas" + }, + { + "name": "health", + "entityType": "schemas" + }, + { + "name": "home", + "entityType": "schemas" + }, + { + "name": "house", + "entityType": "schemas" + }, + { + "name": "meta", + "entityType": "schemas" + }, + { + "name": "money", + "entityType": "schemas" + }, + { + "name": "ref", + "entityType": "schemas" + }, + { + "name": "site", + "entityType": "schemas" + }, + { + "name": "tasks", + "entityType": "schemas" + }, + { + "values": [ + "draft", + "published" + ], + "name": "blog_article_status", + "entityType": "enums", + "schema": "site" + }, + { + "values": [ + "catchable", + "trade_only", + "transfer_only", + "event_only", + "unknown", + "evolve", + "breed" + ], + "name": "availability", + "entityType": "enums", + "schema": "ref" + }, + { + "values": [ + "pending", + "matched", + "low_confidence", + "not_found", + "manual" + ], + "name": "metadata_status", + "entityType": "enums", + "schema": "books" + }, + { + "values": [ + "want_to_read", + "reading", + "finished", + "abandoned" + ], + "name": "reading_status", + "entityType": "enums", + "schema": "books" + }, + { + "isRlsEnabled": false, + "name": "account", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": false, + "name": "session", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": false, + "name": "user", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": false, + "name": "verification", + "entityType": "tables", + "schema": "auth" + }, + { + "isRlsEnabled": false, + "name": "blog_articles", + "entityType": "tables", + "schema": "site" + }, + { + "isRlsEnabled": false, + "name": "tasks", + "entityType": "tables", + "schema": "site" + }, + { + "isRlsEnabled": false, + "name": "task_topics", + "entityType": "tables", + "schema": "site" + }, + { + "isRlsEnabled": false, + "name": "topics", + "entityType": "tables", + "schema": "site" + }, + { + "isRlsEnabled": false, + "name": "catch_em_all_settings", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "pokemon_games", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "pokemon", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "pokemon_encounters", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "pokemon_evolutions", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "pokemon_game_entries", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "pokemon_locations", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "catch_em_all_entries", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "catch_em_all_games", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "tracker_games", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "tracker_items", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "tracker_progress", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "osu_entries", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "pokemon_catches", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "pokemon_dex_numbers", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "pokemon_game_research", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "pokemon_journeys", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "pokemon_learnsets", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "pokemon_milestones", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "pokemon_moves", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "pokemon_research", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "pokemon_seen", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "tracker_challenge_progress", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "tracker_challenges", + "entityType": "tables", + "schema": "ref" + }, + { + "isRlsEnabled": false, + "name": "tracker_ranks", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "tracker_weapon_ranks", + "entityType": "tables", + "schema": "games" + }, + { + "isRlsEnabled": false, + "name": "animals", + "entityType": "tables", + "schema": "animaldex" + }, + { + "isRlsEnabled": false, + "name": "sighting_photos", + "entityType": "tables", + "schema": "animaldex" + }, + { + "isRlsEnabled": false, + "name": "sightings", + "entityType": "tables", + "schema": "animaldex" + }, + { + "isRlsEnabled": false, + "name": "columns", + "entityType": "tables", + "schema": "meta" + }, + { + "isRlsEnabled": false, + "name": "edit_log", + "entityType": "tables", + "schema": "meta" + }, + { + "isRlsEnabled": false, + "name": "tables", + "entityType": "tables", + "schema": "meta" + }, + { + "isRlsEnabled": false, + "name": "accounts", + "entityType": "tables", + "schema": "money" + }, + { + "isRlsEnabled": false, + "name": "bank_sessions", + "entityType": "tables", + "schema": "money" + }, + { + "isRlsEnabled": false, + "name": "forecasts", + "entityType": "tables", + "schema": "money" + }, + { + "isRlsEnabled": false, + "name": "insurances", + "entityType": "tables", + "schema": "money" + }, + { + "isRlsEnabled": false, + "name": "projection_settings", + "entityType": "tables", + "schema": "money" + }, + { + "isRlsEnabled": false, + "name": "recurring", + "entityType": "tables", + "schema": "money" + }, + { + "isRlsEnabled": false, + "name": "transactions", + "entityType": "tables", + "schema": "money" + }, + { + "isRlsEnabled": false, + "name": "utility_readings", + "entityType": "tables", + "schema": "money" + }, + { + "isRlsEnabled": false, + "name": "utility_settings", + "entityType": "tables", + "schema": "money" + }, + { + "isRlsEnabled": false, + "name": "wishlist", + "entityType": "tables", + "schema": "money" + }, + { + "isRlsEnabled": false, + "name": "item_dimensions", + "entityType": "tables", + "schema": "cs" + }, + { + "isRlsEnabled": false, + "name": "items", + "entityType": "tables", + "schema": "cs" + }, + { + "isRlsEnabled": false, + "name": "price_observations", + "entityType": "tables", + "schema": "cs" + }, + { + "isRlsEnabled": false, + "name": "price_streams", + "entityType": "tables", + "schema": "cs" + }, + { + "isRlsEnabled": false, + "name": "alert_rules", + "entityType": "tables", + "schema": "house" + }, + { + "isRlsEnabled": false, + "name": "listings", + "entityType": "tables", + "schema": "house" + }, + { + "isRlsEnabled": false, + "name": "price_history", + "entityType": "tables", + "schema": "house" + }, + { + "isRlsEnabled": false, + "name": "searches", + "entityType": "tables", + "schema": "house" + }, + { + "isRlsEnabled": false, + "name": "worker_runs", + "entityType": "tables", + "schema": "house" + }, + { + "isRlsEnabled": false, + "name": "appointments", + "entityType": "tables", + "schema": "health" + }, + { + "isRlsEnabled": false, + "name": "body_measurements", + "entityType": "tables", + "schema": "health" + }, + { + "isRlsEnabled": false, + "name": "medications", + "entityType": "tables", + "schema": "health" + }, + { + "isRlsEnabled": false, + "name": "nutrition_daily", + "entityType": "tables", + "schema": "health" + }, + { + "isRlsEnabled": false, + "name": "sleep", + "entityType": "tables", + "schema": "health" + }, + { + "isRlsEnabled": false, + "name": "vaccinations", + "entityType": "tables", + "schema": "health" + }, + { + "isRlsEnabled": false, + "name": "workouts", + "entityType": "tables", + "schema": "health" + }, + { + "isRlsEnabled": false, + "name": "files", + "entityType": "tables", + "schema": "books" + }, + { + "isRlsEnabled": false, + "name": "notes", + "entityType": "tables", + "schema": "books" + }, + { + "isRlsEnabled": false, + "name": "progress", + "entityType": "tables", + "schema": "books" + }, + { + "isRlsEnabled": false, + "name": "sessions", + "entityType": "tables", + "schema": "books" + }, + { + "isRlsEnabled": false, + "name": "shelf_works", + "entityType": "tables", + "schema": "books" + }, + { + "isRlsEnabled": false, + "name": "shelves", + "entityType": "tables", + "schema": "books" + }, + { + "isRlsEnabled": false, + "name": "works", + "entityType": "tables", + "schema": "books" + }, + { + "isRlsEnabled": false, + "name": "activity", + "entityType": "tables", + "schema": "tasks" + }, + { + "isRlsEnabled": false, + "name": "areas", + "entityType": "tables", + "schema": "tasks" + }, + { + "isRlsEnabled": false, + "name": "goals", + "entityType": "tables", + "schema": "tasks" + }, + { + "isRlsEnabled": false, + "name": "tasks", + "entityType": "tables", + "schema": "tasks" + }, + { + "isRlsEnabled": false, + "name": "groups", + "entityType": "tables", + "schema": "groceries" + }, + { + "isRlsEnabled": false, + "name": "import_runs", + "entityType": "tables", + "schema": "groceries" + }, + { + "isRlsEnabled": false, + "name": "item_prices", + "entityType": "tables", + "schema": "groceries" + }, + { + "isRlsEnabled": false, + "name": "items", + "entityType": "tables", + "schema": "groceries" + }, + { + "isRlsEnabled": false, + "name": "stores", + "entityType": "tables", + "schema": "groceries" + }, + { + "isRlsEnabled": false, + "name": "links", + "entityType": "tables", + "schema": "home" + }, + { + "isRlsEnabled": false, + "name": "snapshots", + "entityType": "tables", + "schema": "home" + }, + { + "isRlsEnabled": false, + "name": "brands", + "entityType": "tables", + "schema": "cars" + }, + { + "isRlsEnabled": false, + "name": "models", + "entityType": "tables", + "schema": "cars" + }, + { + "isRlsEnabled": false, + "name": "variants", + "entityType": "tables", + "schema": "cars" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "issuer", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id_token", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token_expires_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token_expires_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "password", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ip_address", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "auth", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_verified", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "identifier", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "auth", + "table": "verification" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "site", + "table": "blog_articles" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "site", + "table": "blog_articles" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "site", + "table": "blog_articles" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "site", + "table": "blog_articles" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "tags", + "entityType": "columns", + "schema": "site", + "table": "blog_articles" + }, + { + "type": "blog_article_status", + "typeSchema": "site", + "notNull": true, + "dimensions": 0, + "default": "'draft'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "site", + "table": "blog_articles" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "site", + "table": "blog_articles" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "site", + "table": "blog_articles" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "site", + "table": "tasks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "site", + "table": "tasks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "current_points", + "entityType": "columns", + "schema": "site", + "table": "tasks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "total_points", + "entityType": "columns", + "schema": "site", + "table": "tasks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "site", + "table": "tasks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "site", + "table": "tasks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "site", + "table": "tasks" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "site", + "table": "task_topics" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "task_id", + "entityType": "columns", + "schema": "site", + "table": "task_topics" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "topic_id", + "entityType": "columns", + "schema": "site", + "table": "task_topics" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "site", + "table": "task_topics" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "site", + "table": "task_topics" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "site", + "table": "topics" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "site", + "table": "topics" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "emoji", + "entityType": "columns", + "schema": "site", + "table": "topics" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "site", + "table": "topics" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "site", + "table": "topics" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_settings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_settings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_settings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_settings" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_games" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_games" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_games" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_games" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "generation", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_games" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_games" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "breeding", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_games" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_games" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_games" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "generation", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type1", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type2", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "hp", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attack", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "defense", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "special_attack", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "special_defense", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "speed", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "evolves_from", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "evolution_chain", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "is_baby", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "is_legendary", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "is_mythical", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pokemon_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "area", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "method", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "min_level", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "max_level", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rarity", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "form", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "conditions", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "note", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pokeapi'", + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "from_pokemon_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "to_pokemon_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "method", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pokeapi'", + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pokemon_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "type": "availability", + "typeSchema": "ref", + "notNull": true, + "dimensions": 0, + "default": "'catchable'", + "generated": null, + "identity": null, + "name": "availability", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "note", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pokeapi'", + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "region", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_key", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_credit", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pokeapi'", + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_locations" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_entries" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pokemon_game_entry_id", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_entries" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_entries" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_entries" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_games" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_games" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_games" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_games" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "catch_em_all_games" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "tracker_games" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "ref", + "table": "tracker_games" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "franchise", + "entityType": "columns", + "schema": "ref", + "table": "tracker_games" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "ref", + "table": "tracker_games" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "short_name", + "entityType": "columns", + "schema": "ref", + "table": "tracker_games" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "release_year", + "entityType": "columns", + "schema": "ref", + "table": "tracker_games" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "ref", + "table": "tracker_games" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rules", + "entityType": "columns", + "schema": "ref", + "table": "tracker_games" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "ref", + "table": "tracker_games" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "ref", + "table": "tracker_games" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "post_launch", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "ref", + "table": "tracker_items" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "tracker_progress" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "tracker_progress" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "item_id", + "entityType": "columns", + "schema": "games", + "table": "tracker_progress" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'done'", + "generated": null, + "identity": null, + "name": "milestone", + "entityType": "columns", + "schema": "games", + "table": "tracker_progress" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "tracker_progress" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "tracker_progress" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'osu'", + "generated": null, + "identity": null, + "name": "mode", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "beatmap_url", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "score_url", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pass'", + "generated": null, + "identity": null, + "name": "goal", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'stamina'", + "generated": null, + "identity": null, + "name": "skill", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bpm", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "duration", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accuracy", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "combo", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "misses", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pp", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'NM'", + "generated": null, + "identity": null, + "name": "mods", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "numeric(4,2)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1.00", + "generated": null, + "identity": null, + "name": "rate", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "achieved", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "played_on", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "osu_entries" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pokemon_id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "nickname", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "level", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "moves", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "party_slot", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "shiny", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nature", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ability", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ball", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'caught'", + "generated": null, + "identity": null, + "name": "obtained", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'story'", + "generated": null, + "identity": null, + "name": "stage", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "caught_on", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "pokemon_catches" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_dex_numbers" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pokemon_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_dex_numbers" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_dex_numbers" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dex", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_dex_numbers" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dex_name", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_dex_numbers" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "number", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_dex_numbers" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_research" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version_group", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_research" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "regions", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_game_research" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'story'", + "generated": null, + "identity": null, + "name": "stage", + "entityType": "columns", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "entityType": "columns", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "completed", + "entityType": "columns", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_learnsets" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pokemon_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_learnsets" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version_group", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_learnsets" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "moves", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_learnsets" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'story'", + "generated": null, + "identity": null, + "name": "stage", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "done", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_moves" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_moves" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_moves" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_moves" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "power", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_moves" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accuracy", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_moves" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pp", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_moves" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "priority", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_moves" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "target", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_moves" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pokemon_id", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_research" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "facts", + "entityType": "columns", + "schema": "ref", + "table": "pokemon_research" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_seen" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_seen" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_seen" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pokemon_id", + "entityType": "columns", + "schema": "games", + "table": "pokemon_seen" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "pokemon_seen" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "pokemon_seen" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "challenge_id", + "entityType": "columns", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "current", + "entityType": "columns", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "done", + "entityType": "columns", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key", + "entityType": "columns", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "requirement", + "entityType": "columns", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reward", + "entityType": "columns", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "entityType": "columns", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "target", + "entityType": "columns", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_url", + "entityType": "columns", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "tracker_ranks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "tracker_ranks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "game_id", + "entityType": "columns", + "schema": "games", + "table": "tracker_ranks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "level", + "entityType": "columns", + "schema": "games", + "table": "tracker_ranks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "prestige", + "entityType": "columns", + "schema": "games", + "table": "tracker_ranks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "tracker_ranks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "tracker_ranks" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "item_id", + "entityType": "columns", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "level", + "entityType": "columns", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "prestige", + "entityType": "columns", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "species", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "breed", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "animal_name", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ai_breed_suggestion", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ai_breed_confidence", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "submitted_at", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "denied_at", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "animaldex", + "table": "animals" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "animaldex", + "table": "sighting_photos" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sighting_id", + "entityType": "columns", + "schema": "animaldex", + "table": "sighting_photos" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "r2_key", + "entityType": "columns", + "schema": "animaldex", + "table": "sighting_photos" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "animaldex", + "table": "sighting_photos" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "animaldex", + "table": "sighting_photos" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "uploaded_at", + "entityType": "columns", + "schema": "animaldex", + "table": "sighting_photos" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "animaldex", + "table": "sighting_photos" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "animaldex", + "table": "sighting_photos" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "animal_id", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reporter_name", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seen_at", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lat", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lng", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "submitted_at", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "denied_at", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "animaldex", + "table": "sightings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": { + "type": "byDefault", + "name": "columns_id_seq", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": 1, + "cycle": false + }, + "name": "id", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "table_id", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "column_name", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "label", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ui_type", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "options", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hidden", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "help_text", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "meta", + "table": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": { + "type": "always", + "name": "edit_log_id_seq", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": 1, + "cycle": false + }, + "name": "id", + "entityType": "columns", + "schema": "meta", + "table": "edit_log" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "at", + "entityType": "columns", + "schema": "meta", + "table": "edit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "meta", + "table": "edit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_email", + "entityType": "columns", + "schema": "meta", + "table": "edit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "schema_name", + "entityType": "columns", + "schema": "meta", + "table": "edit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "table_name", + "entityType": "columns", + "schema": "meta", + "table": "edit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "action", + "entityType": "columns", + "schema": "meta", + "table": "edit_log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pk", + "entityType": "columns", + "schema": "meta", + "table": "edit_log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "before", + "entityType": "columns", + "schema": "meta", + "table": "edit_log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "after", + "entityType": "columns", + "schema": "meta", + "table": "edit_log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": { + "type": "byDefault", + "name": "tables_id_seq", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": 1, + "cycle": false + }, + "name": "id", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "schema_name", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "table_name", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "picture_url", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "editable", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "has_done", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "default_sort", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "meta", + "table": "tables" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "opening_balance_cents", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'spendable'", + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "include_in_total", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "color", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'personal'", + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "owner", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "iban", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "external_uid", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'manual'", + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bank_balance_cents", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bank_balance_type", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bank_balance_at", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "money", + "table": "accounts" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'enablebanking'", + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "session_id", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aspsp_name", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aspsp_country", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "psu_type", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'authorized'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "valid_until", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "accounts", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_synced_at", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_error", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "money", + "table": "bank_sessions" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "money", + "table": "forecasts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "money", + "table": "forecasts" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "money", + "table": "forecasts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "money", + "table": "forecasts" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "amount_cents", + "entityType": "columns", + "schema": "money", + "table": "forecasts" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "money", + "table": "forecasts" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "money", + "table": "forecasts" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "money", + "table": "forecasts" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "money", + "table": "insurances" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "money", + "table": "insurances" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "money", + "table": "insurances" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "money", + "table": "insurances" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "coverage", + "entityType": "columns", + "schema": "money", + "table": "insurances" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "premium_cents", + "entityType": "columns", + "schema": "money", + "table": "insurances" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'monthly'", + "generated": null, + "identity": null, + "name": "cadence", + "entityType": "columns", + "schema": "money", + "table": "insurances" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "money", + "table": "insurances" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "money", + "table": "insurances" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "investment_account_id", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "100000", + "generated": null, + "identity": null, + "name": "reserve_cents", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "numeric(5,2)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'5.00'", + "generated": null, + "identity": null, + "name": "annual_return_percent", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'excess'", + "generated": null, + "identity": null, + "name": "contribution_mode", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "include_recurring", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "fixed_monthly_cents", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "end_date", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "money", + "table": "projection_settings" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "money", + "table": "recurring" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "money", + "table": "recurring" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "money", + "table": "recurring" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "amount_cents", + "entityType": "columns", + "schema": "money", + "table": "recurring" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cadence", + "entityType": "columns", + "schema": "money", + "table": "recurring" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "starts_on", + "entityType": "columns", + "schema": "money", + "table": "recurring" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ends_on", + "entityType": "columns", + "schema": "money", + "table": "recurring" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "money", + "table": "recurring" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "money", + "table": "recurring" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "money", + "table": "recurring" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "amount_cents", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "external_id", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'manual'", + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "booking_status", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "counterparty", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "raw", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value_date", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "money", + "table": "transactions" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "money", + "table": "utility_readings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "money", + "table": "utility_readings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "money", + "table": "utility_readings" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "money", + "table": "utility_readings" + }, + { + "type": "numeric(12,3)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reading", + "entityType": "columns", + "schema": "money", + "table": "utility_readings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "money", + "table": "utility_readings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "money", + "table": "utility_readings" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "money", + "table": "utility_settings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "money", + "table": "utility_settings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "money", + "table": "utility_settings" + }, + { + "type": "numeric(12,4)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'0'", + "generated": null, + "identity": null, + "name": "rate_per_unit", + "entityType": "columns", + "schema": "money", + "table": "utility_settings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "monthly_advance_cents", + "entityType": "columns", + "schema": "money", + "table": "utility_settings" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_start", + "entityType": "columns", + "schema": "money", + "table": "utility_settings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "money", + "table": "utility_settings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "money", + "table": "utility_settings" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "money", + "table": "wishlist" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "money", + "table": "wishlist" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "money", + "table": "wishlist" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "estimated_cents", + "entityType": "columns", + "schema": "money", + "table": "wishlist" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "3", + "generated": null, + "identity": null, + "name": "priority", + "entityType": "columns", + "schema": "money", + "table": "wishlist" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "money", + "table": "wishlist" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "money", + "table": "wishlist" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "money", + "table": "wishlist" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "item_id", + "entityType": "columns", + "schema": "cs", + "table": "item_dimensions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key", + "entityType": "columns", + "schema": "cs", + "table": "item_dimensions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "cs", + "table": "item_dimensions" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "cs", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "market_hash_name", + "entityType": "columns", + "schema": "cs", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "cs", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon_url", + "entityType": "columns", + "schema": "cs", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "item_type", + "entityType": "columns", + "schema": "cs", + "table": "items" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "first_seen_at", + "entityType": "columns", + "schema": "cs", + "table": "items" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "last_seen_at", + "entityType": "columns", + "schema": "cs", + "table": "items" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": { + "type": "always", + "name": "price_observations_id_seq", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": 1, + "cycle": false + }, + "name": "id", + "entityType": "columns", + "schema": "cs", + "table": "price_observations" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "item_id", + "entityType": "columns", + "schema": "cs", + "table": "price_observations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "cs", + "table": "price_observations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "cs", + "table": "price_observations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "observed_at", + "entityType": "columns", + "schema": "cs", + "table": "price_observations" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "price_cents", + "entityType": "columns", + "schema": "cs", + "table": "price_observations" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "volume", + "entityType": "columns", + "schema": "cs", + "table": "price_observations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "cs", + "table": "price_observations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "imported_at", + "entityType": "columns", + "schema": "cs", + "table": "price_observations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "cs", + "table": "price_streams" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "cs", + "table": "price_streams" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "cs", + "table": "price_streams" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'rent'", + "generated": null, + "identity": null, + "name": "offer", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "min_price", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "max_price", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "min_area", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "min_bedrooms", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "cities", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "property_types", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "house", + "table": "alert_rules" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_id", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "external_id", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "offer", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "property_type", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "street", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "postal_code", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "city", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "city_slug", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "neighbourhood", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "price_eur", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "area_m2", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rooms", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bedrooms", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bathrooms", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "construction_year", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "energy_label", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "interior", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deposit_eur", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "available_from", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contract_type", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agent", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_url", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "features", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lat", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lng", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "offered_at", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "first_seen_at", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'slow'", + "generated": null, + "identity": null, + "name": "first_seen_lane", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "last_seen_at", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "detail_fetched_at", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "removed_at", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alerted_at", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "address_key", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "duplicate_of", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "total_price_eur", + "entityType": "columns", + "schema": "house", + "table": "listings" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "listing_id", + "entityType": "columns", + "schema": "house", + "table": "price_history" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "observed_at", + "entityType": "columns", + "schema": "house", + "table": "price_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "price_eur", + "entityType": "columns", + "schema": "house", + "table": "price_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "search_url", + "entityType": "columns", + "schema": "house", + "table": "searches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "house", + "table": "searches" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lane", + "entityType": "columns", + "schema": "house", + "table": "searches" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "first_synced_at", + "entityType": "columns", + "schema": "house", + "table": "searches" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "last_synced_at", + "entityType": "columns", + "schema": "house", + "table": "searches" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "last_found", + "entityType": "columns", + "schema": "house", + "table": "searches" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": { + "type": "always", + "name": "worker_runs_id_seq", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "cache": 1, + "cycle": false + }, + "name": "id", + "entityType": "columns", + "schema": "house", + "table": "worker_runs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "house", + "table": "worker_runs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lane", + "entityType": "columns", + "schema": "house", + "table": "worker_runs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "house", + "table": "worker_runs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "house", + "table": "worker_runs" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "http_status", + "entityType": "columns", + "schema": "house", + "table": "worker_runs" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "found", + "entityType": "columns", + "schema": "house", + "table": "worker_runs" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "duration_ms", + "entityType": "columns", + "schema": "house", + "table": "worker_runs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "message", + "entityType": "columns", + "schema": "house", + "table": "worker_runs" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "house", + "table": "worker_runs" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "gen_random_uuid()", + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "health", + "table": "appointments" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "health", + "table": "appointments" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'appointment'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "health", + "table": "appointments" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "health", + "table": "appointments" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "health", + "table": "appointments" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "health", + "table": "appointments" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "health", + "table": "appointments" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "gen_random_uuid()", + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "numeric(5,2)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "weight_kg", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "numeric(5,1)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "waist_cm", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "numeric(4,1)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_fat_pct", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "numeric(5,2)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "muscle_mass_kg", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "numeric(5,2)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "skeletal_muscle_kg", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "numeric(4,2)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bone_mass_kg", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "numeric(4,1)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "visceral_fat", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "numeric(4,1)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body_water_pct", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "numeric(4,1)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "protein_pct", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bmr_kcal", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "numeric(4,1)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bmi", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "measured_at", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "health", + "table": "body_measurements" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "gen_random_uuid()", + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "health", + "table": "medications" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "health", + "table": "medications" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'medication'", + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "health", + "table": "medications" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dose", + "entityType": "columns", + "schema": "health", + "table": "medications" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "frequency", + "entityType": "columns", + "schema": "health", + "table": "medications" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "start_date", + "entityType": "columns", + "schema": "health", + "table": "medications" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stop_date", + "entityType": "columns", + "schema": "health", + "table": "medications" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "health", + "table": "medications" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "health", + "table": "medications" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "health", + "table": "medications" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "gen_random_uuid()", + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "health", + "table": "nutrition_daily" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "health", + "table": "nutrition_daily" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kcal", + "entityType": "columns", + "schema": "health", + "table": "nutrition_daily" + }, + { + "type": "numeric(5,1)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "protein_g", + "entityType": "columns", + "schema": "health", + "table": "nutrition_daily" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "health", + "table": "nutrition_daily" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "health", + "table": "nutrition_daily" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "health", + "table": "nutrition_daily" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "gen_random_uuid()", + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "health", + "table": "sleep" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "health", + "table": "sleep" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bedtime", + "entityType": "columns", + "schema": "health", + "table": "sleep" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "wake_time", + "entityType": "columns", + "schema": "health", + "table": "sleep" + }, + { + "type": "numeric(4,2)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": { + "as": "round((extract(epoch from (wake_time - bedtime)) / 3600)::numeric, 2)", + "type": "stored" + }, + "identity": null, + "name": "hours", + "entityType": "columns", + "schema": "health", + "table": "sleep" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "health", + "table": "sleep" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "health", + "table": "sleep" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "health", + "table": "sleep" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "gen_random_uuid()", + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "vaccine", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "target", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dose_no", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "batch_lot", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "country", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "health", + "table": "vaccinations" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "gen_random_uuid()", + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "session_id", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exercise", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sets", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reps", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "numeric(6,2)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "load_kg", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "numeric(3,1)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rpe", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "health", + "table": "workouts" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "books", + "table": "files" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "work_id", + "entityType": "columns", + "schema": "books", + "table": "files" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "path", + "entityType": "columns", + "schema": "books", + "table": "files" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "format", + "entityType": "columns", + "schema": "books", + "table": "files" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size_bytes", + "entityType": "columns", + "schema": "books", + "table": "files" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sha256", + "entityType": "columns", + "schema": "books", + "table": "files" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "md5", + "entityType": "columns", + "schema": "books", + "table": "files" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "books", + "table": "files" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "books", + "table": "files" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "books", + "table": "files" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "books", + "table": "notes" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "work_id", + "entityType": "columns", + "schema": "books", + "table": "notes" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "file_id", + "entityType": "columns", + "schema": "books", + "table": "notes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locator", + "entityType": "columns", + "schema": "books", + "table": "notes" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "page", + "entityType": "columns", + "schema": "books", + "table": "notes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "highlight", + "entityType": "columns", + "schema": "books", + "table": "notes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "note", + "entityType": "columns", + "schema": "books", + "table": "notes" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "color", + "entityType": "columns", + "schema": "books", + "table": "notes" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "books", + "table": "notes" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "books", + "table": "notes" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "work_id", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "file_id", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locator", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "page", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "percent", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "started_at", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finished_at", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "reading_status", + "typeSchema": "books", + "notNull": true, + "dimensions": 0, + "default": "'want_to_read'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rating", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_read_at", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "books", + "table": "progress" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "work_id", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "file_id", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "started_at", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ended_at", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "start_percent", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "end_percent", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "start_page", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "end_page", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pages_read", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'reader'", + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "note", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "books", + "table": "sessions" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shelf_id", + "entityType": "columns", + "schema": "books", + "table": "shelf_works" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "work_id", + "entityType": "columns", + "schema": "books", + "table": "shelf_works" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "books", + "table": "shelf_works" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "added_at", + "entityType": "columns", + "schema": "books", + "table": "shelf_works" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "books", + "table": "shelves" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "books", + "table": "shelves" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "books", + "table": "shelves" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "books", + "table": "shelves" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "books", + "table": "shelves" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "books", + "table": "shelves" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subtitle", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "authors", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "isbn10", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "isbn13", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "publisher", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "year", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "language", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "page_count", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "tags", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cover_url", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cover_path", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "openlibrary_work_id", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "openlibrary_edition_id", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "google_books_id", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "annas_md5", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "source_refs", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "metadata_status", + "typeSchema": "books", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "metadata_status", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata_source", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata_fetched_at", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "books", + "table": "works" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "tasks", + "table": "activity" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "task_id", + "entityType": "columns", + "schema": "tasks", + "table": "activity" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "goal_id", + "entityType": "columns", + "schema": "tasks", + "table": "activity" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "kind", + "entityType": "columns", + "schema": "tasks", + "table": "activity" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "from_status", + "entityType": "columns", + "schema": "tasks", + "table": "activity" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "to_status", + "entityType": "columns", + "schema": "tasks", + "table": "activity" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "note", + "entityType": "columns", + "schema": "tasks", + "table": "activity" + }, + { + "type": "numeric(14,2)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "tasks", + "table": "activity" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "tasks", + "table": "activity" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "tasks", + "table": "areas" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "tasks", + "table": "areas" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "tasks", + "table": "areas" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "tasks", + "table": "areas" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "color", + "entityType": "columns", + "schema": "tasks", + "table": "areas" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "tasks", + "table": "areas" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "entityType": "columns", + "schema": "tasks", + "table": "areas" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "tasks", + "table": "areas" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "tasks", + "table": "areas" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "area_id", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "target_date", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metric", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metric_unit", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "numeric(14,2)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metric_target", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "numeric(14,2)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metric_current", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "flagged", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "achieved_at", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "tasks", + "table": "goals" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'todo'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "priority", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "flagged", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "due_date", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "time", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "due_time", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reminder_at", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "recurrence", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "area_id", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "goal_id", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "parent_id", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "tags", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "external_id", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "start_at", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "time_zone", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "started_at", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completed_at", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "tasks", + "table": "tasks" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "brand", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "family_key", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "favorite", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "manual", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "merged_into_id", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "notes", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "item_count", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "store_count", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "store_ids", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "min_unit_price_cents", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "min_price_cents", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "promo_count", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_url", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "search_text", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "groceries", + "table": "groups" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "groceries", + "table": "import_runs" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "store_id", + "entityType": "columns", + "schema": "groceries", + "table": "import_runs" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "started_at", + "entityType": "columns", + "schema": "groceries", + "table": "import_runs" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finished_at", + "entityType": "columns", + "schema": "groceries", + "table": "import_runs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'running'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "groceries", + "table": "import_runs" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "requests", + "entityType": "columns", + "schema": "groceries", + "table": "import_runs" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "fetched", + "entityType": "columns", + "schema": "groceries", + "table": "import_runs" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "inserted", + "entityType": "columns", + "schema": "groceries", + "table": "import_runs" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "price_changes", + "entityType": "columns", + "schema": "groceries", + "table": "import_runs" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error", + "entityType": "columns", + "schema": "groceries", + "table": "import_runs" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "groceries", + "table": "item_prices" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "item_id", + "entityType": "columns", + "schema": "groceries", + "table": "item_prices" + }, + { + "type": "date", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "observed_on", + "entityType": "columns", + "schema": "groceries", + "table": "item_prices" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "price_cents", + "entityType": "columns", + "schema": "groceries", + "table": "item_prices" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "promo_price_cents", + "entityType": "columns", + "schema": "groceries", + "table": "item_prices" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "promo_label", + "entityType": "columns", + "schema": "groceries", + "table": "item_prices" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "groceries", + "table": "item_prices" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "store_id", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "store_product_id", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "brand", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size_text", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "numeric(12,4)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit_amount", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit_source", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "price_cents", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "promo_price_cents", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "promo_label", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit_price_cents", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "promo_unit_price_cents", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category_path", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "gtin", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "gtin_checked_at", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_url", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "available", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "first_seen_at", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "last_seen_at", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "group_id", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "match_key", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "match_method", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "match_confidence", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "match_locked", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "groceries", + "table": "items" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "groceries", + "table": "stores" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "groceries", + "table": "stores" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "groceries", + "table": "stores" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "entityType": "columns", + "schema": "groceries", + "table": "stores" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "color", + "entityType": "columns", + "schema": "groceries", + "table": "stores" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "groceries", + "table": "stores" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "entityType": "columns", + "schema": "groceries", + "table": "stores" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "groceries", + "table": "stores" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "groceries", + "table": "stores" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "home", + "table": "links" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "home", + "table": "links" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "home", + "table": "links" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'links'", + "generated": null, + "identity": null, + "name": "section", + "entityType": "columns", + "schema": "home", + "table": "links" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sort_order", + "entityType": "columns", + "schema": "home", + "table": "links" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "home", + "table": "links" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "home", + "table": "links" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key", + "entityType": "columns", + "schema": "home", + "table": "snapshots" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "entityType": "columns", + "schema": "home", + "table": "snapshots" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "collected_at", + "entityType": "columns", + "schema": "home", + "table": "snapshots" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "country", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "model_count", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "nl_count", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "first_year", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_year", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "sources", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "cars", + "table": "brands" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dex", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "brand_id", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "search", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "first_year", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_year", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "bodies", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "size_classes", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "fuels", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "drives", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "transmissions", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "engine_l_min", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "engine_l_max", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cylinders_min", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cylinders_max", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "turbo", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "power_kw_min", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "power_kw_max", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "l100_min", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "l100_max", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "co2_min", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "co2_max", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mpg_min", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mpg_max", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "range_km_max", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seats", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "doors", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mass_kg", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "nl_count", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nl_rank", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nl_first_year", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nl_last_year", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nl_price", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nl_price_latest", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nl_price_latest_year", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "nl_years", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "nl_names", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "us_years", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "variant_count", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "sources", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "cars", + "table": "models" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_id", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'fueleconomy.gov'", + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source_id", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "year", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "engine_l", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cylinders", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "transmission", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "drive", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fuel", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size_class", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mpg_city", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mpg_hwy", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mpg_comb", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "co2_gpm", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "smallint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "range_mi", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ev_motor", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "turbo", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "supercharged", + "entityType": "columns", + "schema": "cars", + "table": "variants" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "account_userId_idx", + "entityType": "indexes", + "schema": "auth", + "table": "account" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "issuer", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "account_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "account_issuer_account_id_unique", + "entityType": "indexes", + "schema": "auth", + "table": "account" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "session_userId_idx", + "entityType": "indexes", + "schema": "auth", + "table": "session" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "identifier", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "verification_identifier_idx", + "entityType": "indexes", + "schema": "auth", + "table": "verification" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "pokemon_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "game_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "pokemon_encounters_pokemon_id_game_id_index", + "entityType": "indexes", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "location_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "pokemon_encounters_location_id_index", + "entityType": "indexes", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "game_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "pokemon_evolutions_game_id_index", + "entityType": "indexes", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "game_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "pokemon_game_entries_game_id_index", + "entityType": "indexes", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "catch_em_all_entries_user_id_index", + "entityType": "indexes", + "schema": "games", + "table": "catch_em_all_entries" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "catch_em_all_games_user_id_index", + "entityType": "indexes", + "schema": "games", + "table": "catch_em_all_games" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "game_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tracker_items_game_id_index", + "entityType": "indexes", + "schema": "ref", + "table": "tracker_items" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tracker_progress_user_id_index", + "entityType": "indexes", + "schema": "games", + "table": "tracker_progress" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "kind", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "osu_entries_user_id_kind_index", + "entityType": "indexes", + "schema": "games", + "table": "osu_entries" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "game_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "pokemon_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "pokemon_catches_user_id_game_id_pokemon_id_index", + "entityType": "indexes", + "schema": "games", + "table": "pokemon_catches" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "game_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "pokemon_dex_numbers_game_id_index", + "entityType": "indexes", + "schema": "ref", + "table": "pokemon_dex_numbers" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "pokemon_seen_user_id_index", + "entityType": "indexes", + "schema": "games", + "table": "pokemon_seen" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "table_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "columns_table_id_index", + "entityType": "indexes", + "schema": "meta", + "table": "columns" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "schema_name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "table_name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "edit_log_table_at_index", + "entityType": "indexes", + "schema": "meta", + "table": "edit_log" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "accounts_user_id_index", + "entityType": "indexes", + "schema": "money", + "table": "accounts" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "bank_sessions_user_id_index", + "entityType": "indexes", + "schema": "money", + "table": "bank_sessions" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "forecasts_user_id_date_index", + "entityType": "indexes", + "schema": "money", + "table": "forecasts" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "insurances_user_id_index", + "entityType": "indexes", + "schema": "money", + "table": "insurances" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "recurring_user_id_index", + "entityType": "indexes", + "schema": "money", + "table": "recurring" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "transactions_user_id_date_id_index", + "entityType": "indexes", + "schema": "money", + "table": "transactions" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "account_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "transactions_account_id_index", + "entityType": "indexes", + "schema": "money", + "table": "transactions" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "kind", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "utility_readings_user_id_kind_date_index", + "entityType": "indexes", + "schema": "money", + "table": "utility_readings" + }, + { + "nameExplicit": false, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "wishlist_user_id_index", + "entityType": "indexes", + "schema": "money", + "table": "wishlist" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "key", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "value", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "item_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "item_dimensions_filter_idx", + "entityType": "indexes", + "schema": "cs", + "table": "item_dimensions" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "market_hash_name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "items_hash_idx", + "entityType": "indexes", + "schema": "cs", + "table": "items" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "items_name_idx", + "entityType": "indexes", + "schema": "cs", + "table": "items" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "item_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "currency", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "observed_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "kind", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "price_observations_unique_idx", + "entityType": "indexes", + "schema": "cs", + "table": "price_observations" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "item_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "currency", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "observed_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "price_observations_lookup_idx", + "entityType": "indexes", + "schema": "cs", + "table": "price_observations" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "observed_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "price_observations_time_idx", + "entityType": "indexes", + "schema": "cs", + "table": "price_observations" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "listings_source_idx", + "entityType": "indexes", + "schema": "house", + "table": "listings" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "offer", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "first_seen_at", + "isExpression": false, + "asc": false, + "nullsFirst": true, + "opclass": null + } + ], + "isUnique": false, + "where": "removed_at IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "listings_active_idx", + "entityType": "indexes", + "schema": "house", + "table": "listings" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "offer", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "city_slug", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "listings_city_idx", + "entityType": "indexes", + "schema": "house", + "table": "listings" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "first_seen_at", + "isExpression": false, + "asc": false, + "nullsFirst": true, + "opclass": null + } + ], + "isUnique": false, + "where": "detail_fetched_at IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "listings_details_idx", + "entityType": "indexes", + "schema": "house", + "table": "listings" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "address_key", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "address_key IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "listings_address_idx", + "entityType": "indexes", + "schema": "house", + "table": "listings" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": false, + "nullsFirst": true, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "worker_runs_created_idx", + "entityType": "indexes", + "schema": "house", + "table": "worker_runs" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "appointments_date_idx", + "entityType": "indexes", + "schema": "health", + "table": "appointments" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "body_measurements_date_idx", + "entityType": "indexes", + "schema": "health", + "table": "body_measurements" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "weight_kg", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "body_measurements_date_weight_key", + "entityType": "indexes", + "schema": "health", + "table": "body_measurements" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "measured_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "body_measurements_measured_at_key", + "entityType": "indexes", + "schema": "health", + "table": "body_measurements" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "start_date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "medications_start_date_idx", + "entityType": "indexes", + "schema": "health", + "table": "medications" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "stop_date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "medications_stop_date_idx", + "entityType": "indexes", + "schema": "health", + "table": "medications" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "vaccinations_date_idx", + "entityType": "indexes", + "schema": "health", + "table": "vaccinations" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workouts_date_idx", + "entityType": "indexes", + "schema": "health", + "table": "workouts" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "session_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "workouts_session_idx", + "entityType": "indexes", + "schema": "health", + "table": "workouts" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "path", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "files_path_key", + "entityType": "indexes", + "schema": "books", + "table": "files" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "sha256", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "files_sha256_key", + "entityType": "indexes", + "schema": "books", + "table": "files" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "work_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "files_work_id_idx", + "entityType": "indexes", + "schema": "books", + "table": "files" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "work_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "notes_work_id_idx", + "entityType": "indexes", + "schema": "books", + "table": "notes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "work_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "progress_work_id_key", + "entityType": "indexes", + "schema": "books", + "table": "progress" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "progress_status_idx", + "entityType": "indexes", + "schema": "books", + "table": "progress" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "work_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "sessions_work_id_idx", + "entityType": "indexes", + "schema": "books", + "table": "sessions" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "started_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "sessions_started_at_idx", + "entityType": "indexes", + "schema": "books", + "table": "sessions" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "work_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "shelf_works_work_id_idx", + "entityType": "indexes", + "schema": "books", + "table": "shelf_works" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "slug", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "shelves_slug_key", + "entityType": "indexes", + "schema": "books", + "table": "shelves" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "isbn13", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"isbn13\" is not null", + "with": "", + "method": "btree", + "concurrently": false, + "name": "works_isbn13_key", + "entityType": "indexes", + "schema": "books", + "table": "works" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "lower(\"title\")", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "works_title_idx", + "entityType": "indexes", + "schema": "books", + "table": "works" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "task_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "activity_task_idx", + "entityType": "indexes", + "schema": "tasks", + "table": "activity" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "goal_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "activity_goal_idx", + "entityType": "indexes", + "schema": "tasks", + "table": "activity" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "slug", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "areas_slug_key", + "entityType": "indexes", + "schema": "tasks", + "table": "areas" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "lower(\"title\")", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "goals_title_key", + "entityType": "indexes", + "schema": "tasks", + "table": "goals" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "area_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tasks_area_idx", + "entityType": "indexes", + "schema": "tasks", + "table": "tasks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "goal_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tasks_goal_idx", + "entityType": "indexes", + "schema": "tasks", + "table": "tasks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "parent_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tasks_parent_idx", + "entityType": "indexes", + "schema": "tasks", + "table": "tasks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "due_date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tasks_status_due_idx", + "entityType": "indexes", + "schema": "tasks", + "table": "tasks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tags", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "tasks_tags_idx", + "entityType": "indexes", + "schema": "tasks", + "table": "tasks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "external_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"external_id\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "tasks_source_external_key", + "entityType": "indexes", + "schema": "tasks", + "table": "tasks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "key", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "groups_key_key", + "entityType": "indexes", + "schema": "groceries", + "table": "groups" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "family_key", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "groups_family_idx", + "entityType": "indexes", + "schema": "groceries", + "table": "groups" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "category", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "groups_category_idx", + "entityType": "indexes", + "schema": "groceries", + "table": "groups" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "store_ids", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "groups_store_ids_idx", + "entityType": "indexes", + "schema": "groceries", + "table": "groups" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "\"search_text\" gin_trgm_ops", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "groups_search_trgm_idx", + "entityType": "indexes", + "schema": "groceries", + "table": "groups" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "store_count", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "groups_list_idx", + "entityType": "indexes", + "schema": "groceries", + "table": "groups" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "store_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "started_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "import_runs_store_idx", + "entityType": "indexes", + "schema": "groceries", + "table": "import_runs" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "item_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "observed_on", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "item_prices_item_day_key", + "entityType": "indexes", + "schema": "groceries", + "table": "item_prices" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "store_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "store_product_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "items_store_product_key", + "entityType": "indexes", + "schema": "groceries", + "table": "items" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "group_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "items_group_idx", + "entityType": "indexes", + "schema": "groceries", + "table": "items" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "gtin", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "items_gtin_idx", + "entityType": "indexes", + "schema": "groceries", + "table": "items" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "\"name\" gin_trgm_ops", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "items_name_trgm_idx", + "entityType": "indexes", + "schema": "groceries", + "table": "items" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "slug", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "stores_slug_key", + "entityType": "indexes", + "schema": "groceries", + "table": "stores" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "section", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sort_order", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "links_sort_idx", + "entityType": "indexes", + "schema": "home", + "table": "links" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "slug", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "brands_slug_key", + "entityType": "indexes", + "schema": "cars", + "table": "brands" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "dex", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "models_dex_key", + "entityType": "indexes", + "schema": "cars", + "table": "models" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "brand_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "slug", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "models_brand_slug_key", + "entityType": "indexes", + "schema": "cars", + "table": "models" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "nl_count", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "models_nl_count_idx", + "entityType": "indexes", + "schema": "cars", + "table": "models" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "\"search\" public.gin_trgm_ops", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "models_search_trgm_idx", + "entityType": "indexes", + "schema": "cars", + "table": "models" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "model_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "year", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "variants_model_year_idx", + "entityType": "indexes", + "schema": "cars", + "table": "variants" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "account_user_id_user_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "account" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "session_user_id_user_id_fkey", + "entityType": "fks", + "schema": "auth", + "table": "session" + }, + { + "nameExplicit": false, + "columns": [ + "task_id" + ], + "schemaTo": "site", + "tableTo": "tasks", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "task_topics_task_id_tasks_id_fkey", + "entityType": "fks", + "schema": "site", + "table": "task_topics" + }, + { + "nameExplicit": false, + "columns": [ + "topic_id" + ], + "schemaTo": "site", + "tableTo": "topics", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "task_topics_topic_id_topics_id_fkey", + "entityType": "fks", + "schema": "site", + "table": "task_topics" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "catch_em_all_settings_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "catch_em_all_settings" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_encounters_pokemon_id_pokemon_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_encounters_game_id_pokemon_games_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_locations", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_encounters_location_id_pokemon_locations_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_encounters" + }, + { + "nameExplicit": false, + "columns": [ + "from_pokemon_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_evolutions_from_pokemon_id_pokemon_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "nameExplicit": false, + "columns": [ + "to_pokemon_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_evolutions_to_pokemon_id_pokemon_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_evolutions_game_id_pokemon_games_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_game_entries_pokemon_id_pokemon_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_game_entries_game_id_pokemon_games_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_game_entry_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_game_entries", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "catch_em_all_entries_HeABXvGNiB6D_fkey", + "entityType": "fks", + "schema": "games", + "table": "catch_em_all_entries" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "catch_em_all_entries_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "catch_em_all_entries" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "catch_em_all_games_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "catch_em_all_games" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "catch_em_all_games_game_id_pokemon_games_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "catch_em_all_games" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "tracker_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tracker_items_game_id_tracker_games_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "tracker_items" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tracker_progress_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "tracker_progress" + }, + { + "nameExplicit": false, + "columns": [ + "item_id" + ], + "schemaTo": "ref", + "tableTo": "tracker_items", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tracker_progress_item_id_tracker_items_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "tracker_progress" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "osu_entries_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "osu_entries" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_catches_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "pokemon_catches" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_catches_game_id_pokemon_games_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "pokemon_catches" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_catches_pokemon_id_pokemon_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "pokemon_catches" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_dex_numbers_pokemon_id_pokemon_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_dex_numbers" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_dex_numbers_game_id_pokemon_games_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_dex_numbers" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_game_research_game_id_pokemon_games_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_game_research" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_journeys_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_journeys_game_id_pokemon_games_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_learnsets_pokemon_id_pokemon_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_learnsets" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_milestones_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_milestones_game_id_pokemon_games_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_research_pokemon_id_pokemon_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "pokemon_research" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_seen_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "pokemon_seen" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_seen_game_id_pokemon_games_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "pokemon_seen" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_id" + ], + "schemaTo": "ref", + "tableTo": "pokemon", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "pokemon_seen_pokemon_id_pokemon_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "pokemon_seen" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tracker_challenge_progress_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "nameExplicit": false, + "columns": [ + "challenge_id" + ], + "schemaTo": "ref", + "tableTo": "tracker_challenges", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tracker_challenge_progress_HtzyFtOyUAhk_fkey", + "entityType": "fks", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "tracker_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tracker_challenges_game_id_tracker_games_id_fkey", + "entityType": "fks", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tracker_ranks_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "tracker_ranks" + }, + { + "nameExplicit": false, + "columns": [ + "game_id" + ], + "schemaTo": "ref", + "tableTo": "tracker_games", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tracker_ranks_game_id_tracker_games_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "tracker_ranks" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tracker_weapon_ranks_user_id_user_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "nameExplicit": false, + "columns": [ + "item_id" + ], + "schemaTo": "ref", + "tableTo": "tracker_items", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tracker_weapon_ranks_item_id_tracker_items_id_fkey", + "entityType": "fks", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "nameExplicit": false, + "columns": [ + "sighting_id" + ], + "schemaTo": "animaldex", + "tableTo": "sightings", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sighting_photos_sighting_id_sightings_id_fkey", + "entityType": "fks", + "schema": "animaldex", + "table": "sighting_photos" + }, + { + "nameExplicit": false, + "columns": [ + "animal_id" + ], + "schemaTo": "animaldex", + "tableTo": "animals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sightings_animal_id_animals_id_fkey", + "entityType": "fks", + "schema": "animaldex", + "table": "sightings" + }, + { + "nameExplicit": false, + "columns": [ + "table_id" + ], + "schemaTo": "meta", + "tableTo": "tables", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "columns_table_id_tables_id_fkey", + "entityType": "fks", + "schema": "meta", + "table": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "accounts_user_id_user_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "accounts" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "bank_sessions_user_id_user_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "bank_sessions" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "forecasts_user_id_user_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "forecasts" + }, + { + "nameExplicit": false, + "columns": [ + "account_id" + ], + "schemaTo": "money", + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "forecasts_account_id_accounts_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "forecasts" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "insurances_user_id_user_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "insurances" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "projection_settings_user_id_user_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "projection_settings" + }, + { + "nameExplicit": false, + "columns": [ + "investment_account_id" + ], + "schemaTo": "money", + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "projection_settings_investment_account_id_accounts_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "projection_settings" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "recurring_user_id_user_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "recurring" + }, + { + "nameExplicit": false, + "columns": [ + "account_id" + ], + "schemaTo": "money", + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "recurring_account_id_accounts_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "recurring" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "transactions_user_id_user_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "transactions" + }, + { + "nameExplicit": false, + "columns": [ + "account_id" + ], + "schemaTo": "money", + "tableTo": "accounts", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "transactions_account_id_accounts_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "transactions" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "utility_readings_user_id_user_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "utility_readings" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "utility_settings_user_id_user_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "utility_settings" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "auth", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "wishlist_user_id_user_id_fkey", + "entityType": "fks", + "schema": "money", + "table": "wishlist" + }, + { + "nameExplicit": false, + "columns": [ + "item_id" + ], + "schemaTo": "cs", + "tableTo": "items", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "item_dimensions_item_id_items_id_fkey", + "entityType": "fks", + "schema": "cs", + "table": "item_dimensions" + }, + { + "nameExplicit": false, + "columns": [ + "item_id" + ], + "schemaTo": "cs", + "tableTo": "items", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "price_observations_item_id_items_id_fkey", + "entityType": "fks", + "schema": "cs", + "table": "price_observations" + }, + { + "nameExplicit": false, + "columns": [ + "duplicate_of" + ], + "schemaTo": "house", + "tableTo": "listings", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "listings_duplicate_of_listings_id_fkey", + "entityType": "fks", + "schema": "house", + "table": "listings" + }, + { + "nameExplicit": false, + "columns": [ + "listing_id" + ], + "schemaTo": "house", + "tableTo": "listings", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "price_history_listing_id_listings_id_fkey", + "entityType": "fks", + "schema": "house", + "table": "price_history" + }, + { + "nameExplicit": false, + "columns": [ + "work_id" + ], + "schemaTo": "books", + "tableTo": "works", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "files_work_id_works_id_fkey", + "entityType": "fks", + "schema": "books", + "table": "files" + }, + { + "nameExplicit": false, + "columns": [ + "work_id" + ], + "schemaTo": "books", + "tableTo": "works", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "notes_work_id_works_id_fkey", + "entityType": "fks", + "schema": "books", + "table": "notes" + }, + { + "nameExplicit": false, + "columns": [ + "file_id" + ], + "schemaTo": "books", + "tableTo": "files", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "notes_file_id_files_id_fkey", + "entityType": "fks", + "schema": "books", + "table": "notes" + }, + { + "nameExplicit": false, + "columns": [ + "work_id" + ], + "schemaTo": "books", + "tableTo": "works", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "progress_work_id_works_id_fkey", + "entityType": "fks", + "schema": "books", + "table": "progress" + }, + { + "nameExplicit": false, + "columns": [ + "file_id" + ], + "schemaTo": "books", + "tableTo": "files", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "progress_file_id_files_id_fkey", + "entityType": "fks", + "schema": "books", + "table": "progress" + }, + { + "nameExplicit": false, + "columns": [ + "work_id" + ], + "schemaTo": "books", + "tableTo": "works", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sessions_work_id_works_id_fkey", + "entityType": "fks", + "schema": "books", + "table": "sessions" + }, + { + "nameExplicit": false, + "columns": [ + "file_id" + ], + "schemaTo": "books", + "tableTo": "files", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "sessions_file_id_files_id_fkey", + "entityType": "fks", + "schema": "books", + "table": "sessions" + }, + { + "nameExplicit": false, + "columns": [ + "shelf_id" + ], + "schemaTo": "books", + "tableTo": "shelves", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "shelf_works_shelf_id_shelves_id_fkey", + "entityType": "fks", + "schema": "books", + "table": "shelf_works" + }, + { + "nameExplicit": false, + "columns": [ + "work_id" + ], + "schemaTo": "books", + "tableTo": "works", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "shelf_works_work_id_works_id_fkey", + "entityType": "fks", + "schema": "books", + "table": "shelf_works" + }, + { + "nameExplicit": false, + "columns": [ + "task_id" + ], + "schemaTo": "tasks", + "tableTo": "tasks", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "activity_task_id_tasks_id_fkey", + "entityType": "fks", + "schema": "tasks", + "table": "activity" + }, + { + "nameExplicit": false, + "columns": [ + "goal_id" + ], + "schemaTo": "tasks", + "tableTo": "goals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "activity_goal_id_goals_id_fkey", + "entityType": "fks", + "schema": "tasks", + "table": "activity" + }, + { + "nameExplicit": false, + "columns": [ + "area_id" + ], + "schemaTo": "tasks", + "tableTo": "areas", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "goals_area_id_areas_id_fkey", + "entityType": "fks", + "schema": "tasks", + "table": "goals" + }, + { + "nameExplicit": false, + "columns": [ + "area_id" + ], + "schemaTo": "tasks", + "tableTo": "areas", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "tasks_area_id_areas_id_fkey", + "entityType": "fks", + "schema": "tasks", + "table": "tasks" + }, + { + "nameExplicit": false, + "columns": [ + "goal_id" + ], + "schemaTo": "tasks", + "tableTo": "goals", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "tasks_goal_id_goals_id_fkey", + "entityType": "fks", + "schema": "tasks", + "table": "tasks" + }, + { + "nameExplicit": false, + "columns": [ + "parent_id" + ], + "schemaTo": "tasks", + "tableTo": "tasks", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tasks_parent_id_tasks_id_fkey", + "entityType": "fks", + "schema": "tasks", + "table": "tasks" + }, + { + "nameExplicit": false, + "columns": [ + "merged_into_id" + ], + "schemaTo": "groceries", + "tableTo": "groups", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "groups_merged_into_id_groups_id_fkey", + "entityType": "fks", + "schema": "groceries", + "table": "groups" + }, + { + "nameExplicit": false, + "columns": [ + "store_id" + ], + "schemaTo": "groceries", + "tableTo": "stores", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "import_runs_store_id_stores_id_fkey", + "entityType": "fks", + "schema": "groceries", + "table": "import_runs" + }, + { + "nameExplicit": false, + "columns": [ + "item_id" + ], + "schemaTo": "groceries", + "tableTo": "items", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "item_prices_item_id_items_id_fkey", + "entityType": "fks", + "schema": "groceries", + "table": "item_prices" + }, + { + "nameExplicit": false, + "columns": [ + "store_id" + ], + "schemaTo": "groceries", + "tableTo": "stores", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "items_store_id_stores_id_fkey", + "entityType": "fks", + "schema": "groceries", + "table": "items" + }, + { + "nameExplicit": false, + "columns": [ + "group_id" + ], + "schemaTo": "groceries", + "tableTo": "groups", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "SET NULL", + "name": "items_group_id_groups_id_fkey", + "entityType": "fks", + "schema": "groceries", + "table": "items" + }, + { + "nameExplicit": false, + "columns": [ + "brand_id" + ], + "schemaTo": "cars", + "tableTo": "brands", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "models_brand_id_brands_id_fkey", + "entityType": "fks", + "schema": "cars", + "table": "models" + }, + { + "nameExplicit": false, + "columns": [ + "model_id" + ], + "schemaTo": "cars", + "tableTo": "models", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "variants_model_id_models_id_fkey", + "entityType": "fks", + "schema": "cars", + "table": "variants" + }, + { + "columns": [ + "item_id", + "key" + ], + "nameExplicit": true, + "name": "item_dimensions_pkey", + "entityType": "pks", + "schema": "cs", + "table": "item_dimensions" + }, + { + "columns": [ + "source", + "currency", + "kind" + ], + "nameExplicit": true, + "name": "price_streams_pkey", + "entityType": "pks", + "schema": "cs", + "table": "price_streams" + }, + { + "columns": [ + "listing_id", + "observed_at" + ], + "nameExplicit": true, + "name": "price_history_pkey", + "entityType": "pks", + "schema": "house", + "table": "price_history" + }, + { + "columns": [ + "shelf_id", + "work_id" + ], + "nameExplicit": false, + "name": "shelf_works_pkey", + "entityType": "pks", + "schema": "books", + "table": "shelf_works" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "account_pkey", + "schema": "auth", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "session_pkey", + "schema": "auth", + "table": "session", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "auth", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "verification_pkey", + "schema": "auth", + "table": "verification", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "blog_articles_pkey", + "schema": "site", + "table": "blog_articles", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tasks_pkey", + "schema": "site", + "table": "tasks", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "task_topics_pkey", + "schema": "site", + "table": "task_topics", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "topics_pkey", + "schema": "site", + "table": "topics", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "catch_em_all_settings_pkey", + "schema": "games", + "table": "catch_em_all_settings", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_games_pkey", + "schema": "ref", + "table": "pokemon_games", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_pkey", + "schema": "ref", + "table": "pokemon", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_encounters_pkey", + "schema": "ref", + "table": "pokemon_encounters", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_evolutions_pkey", + "schema": "ref", + "table": "pokemon_evolutions", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_game_entries_pkey", + "schema": "ref", + "table": "pokemon_game_entries", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_locations_pkey", + "schema": "ref", + "table": "pokemon_locations", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "catch_em_all_entries_pkey", + "schema": "games", + "table": "catch_em_all_entries", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "catch_em_all_games_pkey", + "schema": "games", + "table": "catch_em_all_games", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tracker_games_pkey", + "schema": "ref", + "table": "tracker_games", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tracker_items_pkey", + "schema": "ref", + "table": "tracker_items", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tracker_progress_pkey", + "schema": "games", + "table": "tracker_progress", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "osu_entries_pkey", + "schema": "games", + "table": "osu_entries", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_catches_pkey", + "schema": "games", + "table": "pokemon_catches", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_dex_numbers_pkey", + "schema": "ref", + "table": "pokemon_dex_numbers", + "entityType": "pks" + }, + { + "columns": [ + "game_id" + ], + "nameExplicit": false, + "name": "pokemon_game_research_pkey", + "schema": "ref", + "table": "pokemon_game_research", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_journeys_pkey", + "schema": "games", + "table": "pokemon_journeys", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_learnsets_pkey", + "schema": "ref", + "table": "pokemon_learnsets", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_milestones_pkey", + "schema": "games", + "table": "pokemon_milestones", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_moves_pkey", + "schema": "ref", + "table": "pokemon_moves", + "entityType": "pks" + }, + { + "columns": [ + "pokemon_id" + ], + "nameExplicit": false, + "name": "pokemon_research_pkey", + "schema": "ref", + "table": "pokemon_research", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "pokemon_seen_pkey", + "schema": "games", + "table": "pokemon_seen", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tracker_challenge_progress_pkey", + "schema": "games", + "table": "tracker_challenge_progress", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tracker_challenges_pkey", + "schema": "ref", + "table": "tracker_challenges", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tracker_ranks_pkey", + "schema": "games", + "table": "tracker_ranks", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tracker_weapon_ranks_pkey", + "schema": "games", + "table": "tracker_weapon_ranks", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "animals_pkey", + "schema": "animaldex", + "table": "animals", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sighting_photos_pkey", + "schema": "animaldex", + "table": "sighting_photos", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sightings_pkey", + "schema": "animaldex", + "table": "sightings", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "columns_pkey", + "schema": "meta", + "table": "columns", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "edit_log_pkey", + "schema": "meta", + "table": "edit_log", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tables_pkey", + "schema": "meta", + "table": "tables", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "accounts_pkey", + "schema": "money", + "table": "accounts", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "bank_sessions_pkey", + "schema": "money", + "table": "bank_sessions", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "forecasts_pkey", + "schema": "money", + "table": "forecasts", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "insurances_pkey", + "schema": "money", + "table": "insurances", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "projection_settings_pkey", + "schema": "money", + "table": "projection_settings", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "recurring_pkey", + "schema": "money", + "table": "recurring", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "transactions_pkey", + "schema": "money", + "table": "transactions", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "utility_readings_pkey", + "schema": "money", + "table": "utility_readings", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "utility_settings_pkey", + "schema": "money", + "table": "utility_settings", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "wishlist_pkey", + "schema": "money", + "table": "wishlist", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "items_pkey", + "schema": "cs", + "table": "items", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "price_observations_pkey", + "schema": "cs", + "table": "price_observations", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "alert_rules_pkey", + "schema": "house", + "table": "alert_rules", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "listings_pkey", + "schema": "house", + "table": "listings", + "entityType": "pks" + }, + { + "columns": [ + "search_url" + ], + "nameExplicit": false, + "name": "searches_pkey", + "schema": "house", + "table": "searches", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "worker_runs_pkey", + "schema": "house", + "table": "worker_runs", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "appointments_pkey", + "schema": "health", + "table": "appointments", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "body_measurements_pkey", + "schema": "health", + "table": "body_measurements", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "medications_pkey", + "schema": "health", + "table": "medications", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "nutrition_daily_pkey", + "schema": "health", + "table": "nutrition_daily", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sleep_pkey", + "schema": "health", + "table": "sleep", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "vaccinations_pkey", + "schema": "health", + "table": "vaccinations", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "workouts_pkey", + "schema": "health", + "table": "workouts", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "files_pkey", + "schema": "books", + "table": "files", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "notes_pkey", + "schema": "books", + "table": "notes", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "progress_pkey", + "schema": "books", + "table": "progress", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sessions_pkey", + "schema": "books", + "table": "sessions", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "shelves_pkey", + "schema": "books", + "table": "shelves", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "works_pkey", + "schema": "books", + "table": "works", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "activity_pkey", + "schema": "tasks", + "table": "activity", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "areas_pkey", + "schema": "tasks", + "table": "areas", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "goals_pkey", + "schema": "tasks", + "table": "goals", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tasks_pkey", + "schema": "tasks", + "table": "tasks", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "groups_pkey", + "schema": "groceries", + "table": "groups", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "import_runs_pkey", + "schema": "groceries", + "table": "import_runs", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "item_prices_pkey", + "schema": "groceries", + "table": "item_prices", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "items_pkey", + "schema": "groceries", + "table": "items", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "stores_pkey", + "schema": "groceries", + "table": "stores", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "links_pkey", + "schema": "home", + "table": "links", + "entityType": "pks" + }, + { + "columns": [ + "key" + ], + "nameExplicit": false, + "name": "snapshots_pkey", + "schema": "home", + "table": "snapshots", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "brands_pkey", + "schema": "cars", + "table": "brands", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "models_pkey", + "schema": "cars", + "table": "models", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "variants_pkey", + "schema": "cars", + "table": "variants", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "blog_articles_slug_unique", + "entityType": "uniques", + "schema": "site", + "table": "blog_articles" + }, + { + "nameExplicit": false, + "columns": [ + "task_id", + "topic_id" + ], + "nullsNotDistinct": false, + "name": "task_topics_task_id_topic_id_unique", + "entityType": "uniques", + "schema": "site", + "table": "task_topics" + }, + { + "nameExplicit": false, + "columns": [ + "from_pokemon_id", + "to_pokemon_id", + "game_id", + "method" + ], + "nullsNotDistinct": false, + "name": "pokemon_evolutions_from_pokemon_id_to_pokemon_id_game_id_method_unique", + "entityType": "uniques", + "schema": "ref", + "table": "pokemon_evolutions" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_id", + "game_id" + ], + "nullsNotDistinct": false, + "name": "pokemon_game_entries_pokemon_id_game_id_unique", + "entityType": "uniques", + "schema": "ref", + "table": "pokemon_game_entries" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_game_entry_id", + "user_id" + ], + "nullsNotDistinct": false, + "name": "catch_em_all_entries_pokemon_game_entry_id_user_id_unique", + "entityType": "uniques", + "schema": "games", + "table": "catch_em_all_entries" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "game_id" + ], + "nullsNotDistinct": false, + "name": "catch_em_all_games_user_id_game_id_unique", + "entityType": "uniques", + "schema": "games", + "table": "catch_em_all_games" + }, + { + "nameExplicit": false, + "columns": [ + "game_id", + "key" + ], + "nullsNotDistinct": false, + "name": "tracker_items_game_id_key_unique", + "entityType": "uniques", + "schema": "ref", + "table": "tracker_items" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "item_id", + "milestone" + ], + "nullsNotDistinct": false, + "name": "tracker_progress_user_id_item_id_milestone_unique", + "entityType": "uniques", + "schema": "games", + "table": "tracker_progress" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "game_id", + "party_slot" + ], + "nullsNotDistinct": false, + "name": "pokemon_catches_user_id_game_id_party_slot_unique", + "entityType": "uniques", + "schema": "games", + "table": "pokemon_catches" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_id", + "game_id", + "dex" + ], + "nullsNotDistinct": false, + "name": "pokemon_dex_numbers_pokemon_id_game_id_dex_unique", + "entityType": "uniques", + "schema": "ref", + "table": "pokemon_dex_numbers" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "game_id" + ], + "nullsNotDistinct": false, + "name": "pokemon_journeys_user_id_game_id_unique", + "entityType": "uniques", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "nameExplicit": false, + "columns": [ + "pokemon_id", + "version_group" + ], + "nullsNotDistinct": false, + "name": "pokemon_learnsets_pokemon_id_version_group_unique", + "entityType": "uniques", + "schema": "ref", + "table": "pokemon_learnsets" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "game_id", + "key" + ], + "nullsNotDistinct": false, + "name": "pokemon_milestones_user_id_game_id_key_unique", + "entityType": "uniques", + "schema": "games", + "table": "pokemon_milestones" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "game_id", + "pokemon_id" + ], + "nullsNotDistinct": false, + "name": "pokemon_seen_user_id_game_id_pokemon_id_unique", + "entityType": "uniques", + "schema": "games", + "table": "pokemon_seen" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "challenge_id" + ], + "nullsNotDistinct": false, + "name": "tracker_challenge_progress_user_id_challenge_id_unique", + "entityType": "uniques", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "nameExplicit": false, + "columns": [ + "game_id", + "key" + ], + "nullsNotDistinct": false, + "name": "tracker_challenges_game_id_key_unique", + "entityType": "uniques", + "schema": "ref", + "table": "tracker_challenges" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "game_id" + ], + "nullsNotDistinct": false, + "name": "tracker_ranks_user_id_game_id_unique", + "entityType": "uniques", + "schema": "games", + "table": "tracker_ranks" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "item_id" + ], + "nullsNotDistinct": false, + "name": "tracker_weapon_ranks_user_id_item_id_unique", + "entityType": "uniques", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "nameExplicit": true, + "columns": [ + "table_id", + "column_name" + ], + "nullsNotDistinct": false, + "name": "columns_table_id_column_name_key", + "entityType": "uniques", + "schema": "meta", + "table": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "schema_name", + "table_name" + ], + "nullsNotDistinct": false, + "name": "tables_schema_name_table_name_key", + "entityType": "uniques", + "schema": "meta", + "table": "tables" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "name" + ], + "nullsNotDistinct": false, + "name": "accounts_user_id_name_unique", + "entityType": "uniques", + "schema": "money", + "table": "accounts" + }, + { + "nameExplicit": true, + "columns": [ + "external_uid" + ], + "nullsNotDistinct": false, + "name": "accounts_external_uid_key", + "entityType": "uniques", + "schema": "money", + "table": "accounts" + }, + { + "nameExplicit": true, + "columns": [ + "session_id" + ], + "nullsNotDistinct": false, + "name": "bank_sessions_session_id_key", + "entityType": "uniques", + "schema": "money", + "table": "bank_sessions" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "projection_settings_user_id_unique", + "entityType": "uniques", + "schema": "money", + "table": "projection_settings" + }, + { + "nameExplicit": true, + "columns": [ + "account_id", + "external_id" + ], + "nullsNotDistinct": false, + "name": "transactions_account_external_id_key", + "entityType": "uniques", + "schema": "money", + "table": "transactions" + }, + { + "nameExplicit": false, + "columns": [ + "user_id", + "kind" + ], + "nullsNotDistinct": false, + "name": "utility_settings_user_id_kind_unique", + "entityType": "uniques", + "schema": "money", + "table": "utility_settings" + }, + { + "nameExplicit": false, + "columns": [ + "token" + ], + "nullsNotDistinct": false, + "name": "session_token_key", + "schema": "auth", + "table": "session", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_key", + "schema": "auth", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "catch_em_all_settings_user_id_key", + "schema": "games", + "table": "catch_em_all_settings", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "source_id" + ], + "nullsNotDistinct": false, + "name": "pokemon_games_source_id_key", + "schema": "ref", + "table": "pokemon_games", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "pokemon_games_slug_key", + "schema": "ref", + "table": "pokemon_games", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "number" + ], + "nullsNotDistinct": false, + "name": "pokemon_number_key", + "schema": "ref", + "table": "pokemon", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "source_id" + ], + "nullsNotDistinct": false, + "name": "pokemon_locations_source_id_key", + "schema": "ref", + "table": "pokemon_locations", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "tracker_games_slug_key", + "schema": "ref", + "table": "tracker_games", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "tables_slug_key", + "schema": "meta", + "table": "tables", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + "date" + ], + "nullsNotDistinct": false, + "name": "nutrition_daily_date_key", + "schema": "health", + "table": "nutrition_daily", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + "date" + ], + "nullsNotDistinct": false, + "name": "sleep_date_key", + "schema": "health", + "table": "sleep", + "entityType": "uniques" + }, + { + "value": "\"kind\" IN ('score','goal','training')", + "name": "osu_entries_kind_check", + "entityType": "checks", + "schema": "games", + "table": "osu_entries" + }, + { + "value": "\"level\" between 1 and 100", + "name": "pokemon_catches_level_check", + "entityType": "checks", + "schema": "games", + "table": "pokemon_catches" + }, + { + "value": "\"party_slot\" between 1 and 6", + "name": "pokemon_catches_party_slot_check", + "entityType": "checks", + "schema": "games", + "table": "pokemon_catches" + }, + { + "value": "cardinality(\"moves\") <= 4", + "name": "pokemon_catches_moves_check", + "entityType": "checks", + "schema": "games", + "table": "pokemon_catches" + }, + { + "value": "\"stage\" IN ('story','postgame','collection')", + "name": "pokemon_catches_stage_check", + "entityType": "checks", + "schema": "games", + "table": "pokemon_catches" + }, + { + "value": "\"stage\" IN ('story','postgame','collection')", + "name": "pokemon_journeys_stage_check", + "entityType": "checks", + "schema": "games", + "table": "pokemon_journeys" + }, + { + "value": "\"current\" >= 0", + "name": "tracker_challenge_progress_current_check", + "entityType": "checks", + "schema": "games", + "table": "tracker_challenge_progress" + }, + { + "value": "\"level\" between 1 and 10000", + "name": "tracker_ranks_level_check", + "entityType": "checks", + "schema": "games", + "table": "tracker_ranks" + }, + { + "value": "\"prestige\" between 0 and 1000", + "name": "tracker_ranks_prestige_check", + "entityType": "checks", + "schema": "games", + "table": "tracker_ranks" + }, + { + "value": "\"level\" between 1 and 10000", + "name": "tracker_weapon_ranks_level_check", + "entityType": "checks", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "value": "\"prestige\" between 0 and 1000", + "name": "tracker_weapon_ranks_prestige_check", + "entityType": "checks", + "schema": "games", + "table": "tracker_weapon_ranks" + }, + { + "value": "ui_type IN ('text','longtext','url','image','number','cents','date','datetime','bool','select','multiselect','fk','json')", + "name": "columns_ui_type_check", + "entityType": "checks", + "schema": "meta", + "table": "columns" + }, + { + "value": "action IN ('insert','update','delete','import','add_column')", + "name": "edit_log_action_check", + "entityType": "checks", + "schema": "meta", + "table": "edit_log" + }, + { + "value": "slug ~ '^[a-z0-9][a-z0-9-]{0,62}$'", + "name": "tables_slug_check", + "entityType": "checks", + "schema": "meta", + "table": "tables" + }, + { + "value": "kind IN ('list','core','ref')", + "name": "tables_kind_check", + "entityType": "checks", + "schema": "meta", + "table": "tables" + }, + { + "value": "kind IN ('spendable','investment')", + "name": "accounts_kind_check", + "entityType": "checks", + "schema": "money", + "table": "accounts" + }, + { + "value": "scope IN ('personal','joint')", + "name": "accounts_scope_check", + "entityType": "checks", + "schema": "money", + "table": "accounts" + }, + { + "value": "provider IN ('manual','enablebanking')", + "name": "accounts_provider_check", + "entityType": "checks", + "schema": "money", + "table": "accounts" + }, + { + "value": "status IN ('authorized','expired','revoked','error')", + "name": "bank_sessions_status_check", + "entityType": "checks", + "schema": "money", + "table": "bank_sessions" + }, + { + "value": "cadence IN ('weekly','monthly','yearly')", + "name": "insurances_cadence_check", + "entityType": "checks", + "schema": "money", + "table": "insurances" + }, + { + "value": "contribution_mode IN ('excess','fixed')", + "name": "projection_settings_contribution_mode_check", + "entityType": "checks", + "schema": "money", + "table": "projection_settings" + }, + { + "value": "cadence IN ('weekly','monthly','yearly')", + "name": "recurring_cadence_check", + "entityType": "checks", + "schema": "money", + "table": "recurring" + }, + { + "value": "source IN ('manual','csv','enablebanking')", + "name": "transactions_source_check", + "entityType": "checks", + "schema": "money", + "table": "transactions" + }, + { + "value": "kind IN ('electricity','gas','water')", + "name": "utility_readings_kind_check", + "entityType": "checks", + "schema": "money", + "table": "utility_readings" + }, + { + "value": "kind IN ('electricity','gas','water')", + "name": "utility_settings_kind_check", + "entityType": "checks", + "schema": "money", + "table": "utility_settings" + }, + { + "value": "offer IN ('rent', 'buy')", + "name": "alert_rules_offer_check", + "entityType": "checks", + "schema": "house", + "table": "alert_rules" + }, + { + "value": "offer IN ('rent', 'buy')", + "name": "listings_offer_check", + "entityType": "checks", + "schema": "house", + "table": "listings" + }, + { + "value": "price_eur IS NULL OR price_eur >= 0", + "name": "listings_price_eur_check", + "entityType": "checks", + "schema": "house", + "table": "listings" + }, + { + "value": "\"type\" IN ('appointment','checkup','condition','test','procedure','other')", + "name": "appointments_type_check", + "entityType": "checks", + "schema": "health", + "table": "appointments" + }, + { + "value": "\"date\" >= DATE '1900-01-01'", + "name": "appointments_date_check", + "entityType": "checks", + "schema": "health", + "table": "appointments" + }, + { + "value": "\"weight_kg\" IS NOT NULL OR \"waist_cm\" IS NOT NULL OR \"body_fat_pct\" IS NOT NULL", + "name": "body_measurements_any_check", + "entityType": "checks", + "schema": "health", + "table": "body_measurements" + }, + { + "value": "\"weight_kg\" IS NULL OR \"weight_kg\" BETWEEN 20 AND 400", + "name": "body_measurements_weight_check", + "entityType": "checks", + "schema": "health", + "table": "body_measurements" + }, + { + "value": "\"waist_cm\" IS NULL OR \"waist_cm\" BETWEEN 30 AND 250", + "name": "body_measurements_waist_check", + "entityType": "checks", + "schema": "health", + "table": "body_measurements" + }, + { + "value": "\"body_fat_pct\" IS NULL OR \"body_fat_pct\" BETWEEN 1 AND 75", + "name": "body_measurements_fat_check", + "entityType": "checks", + "schema": "health", + "table": "body_measurements" + }, + { + "value": "(\"muscle_mass_kg\" IS NULL OR \"muscle_mass_kg\" BETWEEN 5 AND 250)\n\t\t\tAND (\"skeletal_muscle_kg\" IS NULL OR \"skeletal_muscle_kg\" BETWEEN 5 AND 200)\n\t\t\tAND (\"bone_mass_kg\" IS NULL OR \"bone_mass_kg\" BETWEEN 0.5 AND 20)\n\t\t\tAND (\"visceral_fat\" IS NULL OR \"visceral_fat\" BETWEEN 1 AND 60)\n\t\t\tAND (\"body_water_pct\" IS NULL OR \"body_water_pct\" BETWEEN 20 AND 85)\n\t\t\tAND (\"protein_pct\" IS NULL OR \"protein_pct\" BETWEEN 5 AND 40)\n\t\t\tAND (\"bmr_kcal\" IS NULL OR \"bmr_kcal\" BETWEEN 500 AND 6000)\n\t\t\tAND (\"bmi\" IS NULL OR \"bmi\" BETWEEN 10 AND 80)", + "name": "body_measurements_scale_check", + "entityType": "checks", + "schema": "health", + "table": "body_measurements" + }, + { + "value": "\"date\" >= DATE '1900-01-01'", + "name": "body_measurements_date_check", + "entityType": "checks", + "schema": "health", + "table": "body_measurements" + }, + { + "value": "length(btrim(\"name\")) > 0", + "name": "medications_name_check", + "entityType": "checks", + "schema": "health", + "table": "medications" + }, + { + "value": "\"kind\" IN ('medication','supplement')", + "name": "medications_kind_check", + "entityType": "checks", + "schema": "health", + "table": "medications" + }, + { + "value": "\"stop_date\" IS NULL OR \"start_date\" IS NULL OR \"stop_date\" >= \"start_date\"", + "name": "medications_dates_check", + "entityType": "checks", + "schema": "health", + "table": "medications" + }, + { + "value": "\"kcal\" IS NULL OR \"kcal\" BETWEEN 0 AND 20000", + "name": "nutrition_daily_kcal_check", + "entityType": "checks", + "schema": "health", + "table": "nutrition_daily" + }, + { + "value": "\"protein_g\" IS NULL OR \"protein_g\" BETWEEN 0 AND 1000", + "name": "nutrition_daily_protein_check", + "entityType": "checks", + "schema": "health", + "table": "nutrition_daily" + }, + { + "value": "\"date\" >= DATE '1900-01-01'", + "name": "nutrition_daily_date_check", + "entityType": "checks", + "schema": "health", + "table": "nutrition_daily" + }, + { + "value": "\"wake_time\" > \"bedtime\"", + "name": "sleep_order_check", + "entityType": "checks", + "schema": "health", + "table": "sleep" + }, + { + "value": "\"wake_time\" - \"bedtime\" <= interval '24 hours'", + "name": "sleep_length_check", + "entityType": "checks", + "schema": "health", + "table": "sleep" + }, + { + "value": "\"date\" >= DATE '1900-01-01'", + "name": "sleep_date_check", + "entityType": "checks", + "schema": "health", + "table": "sleep" + }, + { + "value": "length(btrim(\"vaccine\")) > 0", + "name": "vaccinations_vaccine_check", + "entityType": "checks", + "schema": "health", + "table": "vaccinations" + }, + { + "value": "\"dose_no\" IS NULL OR \"dose_no\" BETWEEN 1 AND 20", + "name": "vaccinations_dose_no_check", + "entityType": "checks", + "schema": "health", + "table": "vaccinations" + }, + { + "value": "\"country\" IS NULL OR \"country\" ~ '^[A-Z]{2}$'", + "name": "vaccinations_country_check", + "entityType": "checks", + "schema": "health", + "table": "vaccinations" + }, + { + "value": "\"date\" >= DATE '1900-01-01'", + "name": "vaccinations_date_check", + "entityType": "checks", + "schema": "health", + "table": "vaccinations" + }, + { + "value": "length(btrim(\"exercise\")) > 0", + "name": "workouts_exercise_check", + "entityType": "checks", + "schema": "health", + "table": "workouts" + }, + { + "value": "\"sets\" IS NULL OR \"sets\" BETWEEN 1 AND 100", + "name": "workouts_sets_check", + "entityType": "checks", + "schema": "health", + "table": "workouts" + }, + { + "value": "\"reps\" IS NULL OR \"reps\" BETWEEN 0 AND 1000", + "name": "workouts_reps_check", + "entityType": "checks", + "schema": "health", + "table": "workouts" + }, + { + "value": "\"load_kg\" IS NULL OR \"load_kg\" BETWEEN 0 AND 1000", + "name": "workouts_load_check", + "entityType": "checks", + "schema": "health", + "table": "workouts" + }, + { + "value": "\"rpe\" IS NULL OR \"rpe\" BETWEEN 1 AND 10", + "name": "workouts_rpe_check", + "entityType": "checks", + "schema": "health", + "table": "workouts" + }, + { + "value": "\"date\" >= DATE '1900-01-01'", + "name": "workouts_date_check", + "entityType": "checks", + "schema": "health", + "table": "workouts" + }, + { + "value": "\"percent\" between 0 and 100", + "name": "progress_percent_check", + "entityType": "checks", + "schema": "books", + "table": "progress" + }, + { + "value": "\"rating\" is null or \"rating\" between 1 and 5", + "name": "progress_rating_check", + "entityType": "checks", + "schema": "books", + "table": "progress" + }, + { + "value": "(\"start_percent\" is null or \"start_percent\" between 0 and 100) and (\"end_percent\" is null or \"end_percent\" between 0 and 100)", + "name": "sessions_percent_check", + "entityType": "checks", + "schema": "books", + "table": "sessions" + }, + { + "value": "\"ended_at\" is null or \"ended_at\" >= \"started_at\"", + "name": "sessions_end_check", + "entityType": "checks", + "schema": "books", + "table": "sessions" + }, + { + "value": "\"year\" is null or \"year\" between 0 and 2100", + "name": "works_year_check", + "entityType": "checks", + "schema": "books", + "table": "works" + }, + { + "value": "\"task_id\" IS NOT NULL OR \"goal_id\" IS NOT NULL", + "name": "activity_target_check", + "entityType": "checks", + "schema": "tasks", + "table": "activity" + }, + { + "value": "\"kind\" IN ('created','status','edit','note','progress')", + "name": "activity_kind_check", + "entityType": "checks", + "schema": "tasks", + "table": "activity" + }, + { + "value": "\"slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}$'", + "name": "areas_slug_check", + "entityType": "checks", + "schema": "tasks", + "table": "areas" + }, + { + "value": "length(btrim(\"name\")) > 0", + "name": "areas_name_check", + "entityType": "checks", + "schema": "tasks", + "table": "areas" + }, + { + "value": "length(btrim(\"title\")) > 0", + "name": "goals_title_check", + "entityType": "checks", + "schema": "tasks", + "table": "goals" + }, + { + "value": "\"status\" IN ('active','achieved','dropped')", + "name": "goals_status_check", + "entityType": "checks", + "schema": "tasks", + "table": "goals" + }, + { + "value": "length(btrim(\"title\")) > 0", + "name": "tasks_title_check", + "entityType": "checks", + "schema": "tasks", + "table": "tasks" + }, + { + "value": "\"status\" IN ('todo','in_progress','done','dropped')", + "name": "tasks_status_check", + "entityType": "checks", + "schema": "tasks", + "table": "tasks" + }, + { + "value": "\"priority\" BETWEEN 0 AND 3", + "name": "tasks_priority_check", + "entityType": "checks", + "schema": "tasks", + "table": "tasks" + }, + { + "value": "\"parent_id\" IS NULL OR \"parent_id\" <> \"id\"", + "name": "tasks_parent_check", + "entityType": "checks", + "schema": "tasks", + "table": "tasks" + }, + { + "value": "\"due_time\" IS NULL OR \"due_date\" IS NOT NULL", + "name": "tasks_time_check", + "entityType": "checks", + "schema": "tasks", + "table": "tasks" + }, + { + "value": "length(btrim(\"name\")) > 0", + "name": "groups_name_check", + "entityType": "checks", + "schema": "groceries", + "table": "groups" + }, + { + "value": "\"unit\" IS NULL OR \"unit\" IN ('piece','kg','l')", + "name": "groups_unit_check", + "entityType": "checks", + "schema": "groceries", + "table": "groups" + }, + { + "value": "\"merged_into_id\" IS NULL OR \"merged_into_id\" <> \"id\"", + "name": "groups_not_self_merged", + "entityType": "checks", + "schema": "groceries", + "table": "groups" + }, + { + "value": "\"unit\" IS NULL OR \"unit\" IN ('piece','kg','l')", + "name": "items_unit_check", + "entityType": "checks", + "schema": "groceries", + "table": "items" + }, + { + "value": "\"price_cents\" IS NULL OR \"price_cents\" >= 0", + "name": "items_price_check", + "entityType": "checks", + "schema": "groceries", + "table": "items" + }, + { + "value": "\"slug\" ~ '^[a-z0-9][a-z0-9-]{0,62}$'", + "name": "stores_slug_check", + "entityType": "checks", + "schema": "groceries", + "table": "stores" + }, + { + "value": "length(btrim(\"name\")) > 0", + "name": "stores_name_check", + "entityType": "checks", + "schema": "groceries", + "table": "stores" + }, + { + "value": "length(btrim(\"title\")) between 1 and 80", + "name": "links_title_check", + "entityType": "checks", + "schema": "home", + "table": "links" + }, + { + "value": "\"url\" ~ '^https?://' and length(\"url\") <= 2000", + "name": "links_url_check", + "entityType": "checks", + "schema": "home", + "table": "links" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/package.json b/package.json index 1fcb7fd..b3ea45d 100755 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "preview:branch": "bash scripts/preview.sh", "db:studio": "drizzle-kit studio", "db:seed": "bun scripts/seed-catalog.ts", + "cars:import": "bun scripts/cars-import.ts", "db:seed:cod": "bun scripts/seed-cod-catalog.ts", "cs-prices:ingest": "bun scripts/ingest-cs-prices.ts", "house:worker": "bun scripts/house-worker.ts", diff --git a/scripts/cars-import.ts b/scripts/cars-import.ts new file mode 100644 index 0000000..f633a73 --- /dev/null +++ b/scripts/cars-import.ts @@ -0,0 +1,1055 @@ +// Builds the public car pokedex (/trackers/cars, schema `cars`) from open data. +// +// DB_URL=... bun scripts/cars-import.ts fetch sources and write to the database +// bun scripts/cars-import.ts --dry-run fetch + build only, print a summary +// bun scripts/cars-import.ts --cache /tmp/cars reuse raw downloads from that folder +// bun scripts/cars-import.ts --dry-run --out x.json also dump the built catalogue +// +// Sources (no API keys): +// - fueleconomy.gov vehicles.csv: every US EPA-tested car since 1984 (make, base model, +// year, engine, cylinders, transmission, drive, fuel, size class, MPG, CO2, EV range). +// - RDW open data (Socrata, aggregated server-side, nothing big is downloaded): +// m9d7-ebf2 Gekentekende voertuigen: passenger cars registered in NL grouped by +// make + trade name (count, years, catalogue price, mass, body, seats). +// 8ys7-d773 brandstof: fuel, power, consumption and CO2 for one sample car per +// model per first-registration year (the dataset has no make column, and +// Socrata here does not support joins). +// Re-runnable: brands/models are upserted by slug (Dex numbers stay stable, new models get +// the next number), models that vanished are deleted, variants are replaced. +import postgres from 'postgres'; +import { mkdir, readFile, writeFile } from 'node:fs/promises'; +import { join } from 'node:path'; + +const args = process.argv.slice(2); +const dryRun = args.includes('--dry-run'); +const cacheDir = args.includes('--cache') ? args[args.indexOf('--cache') + 1] : null; +const outFile = args.includes('--out') ? args[args.indexOf('--out') + 1] : null; + +const FE_URL = 'https://www.fueleconomy.gov/feg/epadata/vehicles.csv'; +const RDW = 'https://opendata.rdw.nl/resource'; +const RDW_CARS = `${RDW}/m9d7-ebf2.json`; +const RDW_FUEL = `${RDW}/8ys7-d773.json`; +const SRC_FE = 'fueleconomy.gov'; +const SRC_RDW = 'RDW open data'; +// Passenger cars only; motorhomes, hearses, ambulances and wheelchair conversions are +// registered as "Personenauto" too but are not cars you would buy off a forecourt. +const RDW_WHERE = + "voertuigsoort='Personenauto' AND inrichting not in ('kampeerwagen','ambulance','lijkwagen','voor rolstoelen toegankelijk voertuig','huifopbouw')"; +const MIN_NL_NAME = 5; // trade names with fewer NL registrations are mostly typos and one-offs +const MIN_NL_FAMILY = 20; // a trade name needs this many to stand as a model on its own +const MIN_NL_MAKE = 50; // NL-only makes need this many cars in total + +// ---------------------------------------------------------------- fetching + +async function cached(name: string, load: () => Promise): Promise { + if (cacheDir) { + try { + return JSON.parse(await readFile(join(cacheDir, name), 'utf8')) as T; + } catch { + // not cached yet + } + } + const value = await load(); + if (cacheDir) { + await mkdir(cacheDir, { recursive: true }); + await writeFile(join(cacheDir, name), JSON.stringify(value)); + } + return value; +} + +async function getJson(url: string, params: Record, tries = 4): Promise { + const u = new URL(url); + for (const [k, v] of Object.entries(params)) u.searchParams.set(k, v); + for (let attempt = 1; ; attempt++) { + try { + const res = await fetch(u, { signal: AbortSignal.timeout(300_000) }); + if (!res.ok) throw new Error(`${res.status} ${(await res.text()).slice(0, 200)}`); + return (await res.json()) as T; + } catch (err) { + if (attempt >= tries) throw err; + await Bun.sleep(2000 * attempt); + } + } +} + +function parseCsv(text: string): Record[] { + const rows: string[][] = []; + let row: string[] = []; + let field = ''; + let quoted = false; + for (let i = 0; i < text.length; i++) { + const c = text[i]; + if (quoted) { + if (c === '"') { + if (text[i + 1] === '"') { + field += '"'; + i++; + } else quoted = false; + } else field += c; + } else if (c === '"') quoted = true; + else if (c === ',') { + row.push(field); + field = ''; + } else if (c === '\n' || c === '\r') { + if (c === '\r' && text[i + 1] === '\n') i++; + row.push(field); + rows.push(row); + row = []; + field = ''; + } else field += c; + } + if (field || row.length) rows.push([...row, field]); + const [header, ...body] = rows; + return body + .filter((r) => r.length === header.length) + .map((r) => Object.fromEntries(header.map((h, i) => [h, r[i]]))); +} + +type RdwModel = { + merk: string; + handelsbenaming?: string; + n: string; + price?: string; + mass?: string; + cc?: string; + cyl?: string; +}; +type RdwYear = { + merk: string; + handelsbenaming?: string; + y?: string; + n: string; + p?: string; + k: string; +}; +type RdwBody = { + merk: string; + handelsbenaming?: string; + inrichting?: string; + n: string; + seats?: string; + doors?: string; +}; +type RdwFuel = { + kenteken: string; + brandstof_omschrijving?: string; + klasse_hybride_elektrisch_voertuig?: string; + nettomaximumvermogen?: string; + brandstofverbruik_gecombineerd?: string; + brandstof_verbruik_gecombineerd_wltp?: string; + co2_uitstoot_gecombineerd?: string; + emissie_co2_gecombineerd_wltp?: string; +}; + +async function loadSources() { + const fe = await cached('fe.json', async () => { + console.log('fetching fueleconomy.gov vehicles.csv'); + const res = await fetch(FE_URL, { signal: AbortSignal.timeout(300_000) }); + if (!res.ok) throw new Error(`fueleconomy.gov ${res.status}`); + return parseCsv(await res.text()); + }); + const group = (select: string, groupBy: string, having?: string) => ({ + $select: select, + $where: RDW_WHERE, + $group: groupBy, + ...(having ? { $having: having } : {}), + $limit: '2000000' + }); + console.log('querying RDW aggregates'); + const [models, years, bodies] = await Promise.all([ + cached('rdw-models.json', () => + getJson( + RDW_CARS, + group( + 'merk,handelsbenaming,count(*) as n,avg(catalogusprijs) as price,avg(massa_rijklaar) as mass,avg(cilinderinhoud) as cc,avg(aantal_cilinders) as cyl', + 'merk,handelsbenaming', + `n >= ${MIN_NL_NAME}` + ) + ) + ), + cached('rdw-years.json', () => + getJson( + RDW_CARS, + group( + 'merk,handelsbenaming,date_extract_y(datum_eerste_toelating_dt) as y,count(*) as n,avg(catalogusprijs) as p,max(kenteken) as k', + 'merk,handelsbenaming,y', + 'n >= 3' + ) + ) + ), + cached('rdw-bodies.json', () => + getJson( + RDW_CARS, + group( + 'merk,handelsbenaming,inrichting,count(*) as n,avg(aantal_zitplaatsen) as seats,avg(aantal_deuren) as doors', + 'merk,handelsbenaming,inrichting', + 'n >= 3' + ) + ) + ) + ]); + return { fe, models, years, bodies }; +} + +async function loadFuel(plates: string[]): Promise { + const out: RdwFuel[] = []; + const chunks: string[][] = []; + for (let i = 0; i < plates.length; i += 250) chunks.push(plates.slice(i, i + 250)); + let next = 0; + async function worker() { + while (next < chunks.length) { + const chunk = chunks[next++]; + const list = chunk.map((p) => `'${p.replace(/[^A-Z0-9]/g, '')}'`).join(','); + out.push( + ...(await getJson(RDW_FUEL, { + $where: `kenteken in(${list})`, + $limit: '5000' + })) + ); + } + } + await Promise.all(Array.from({ length: 4 }, worker)); + return out; +} + +// ---------------------------------------------------------------- normalising + +const MAKE_ALIASES: Record = { + VW: 'VOLKSWAGEN', + BMWI: 'BMW', + BMWALPINA: 'ALPINA', + TESLAMOTORS: 'TESLA', + MERCEDES: 'MERCEDESBENZ', + MERCEDESAMG: 'MERCEDESBENZ', + DAIMLERBENZ: 'MERCEDESBENZ', + CITROEN: 'CITROEN', + LYNKCO: 'LYNKCO', + DSAUTOMOBILES: 'DS', + MCLARENAUTOMOTIVE: 'MCLAREN', + ROLLSROYCEMOTORCARS: 'ROLLSROYCE', + GENERALMOTORS: 'GM', + MGROVER: 'MG', + FORDCNGTECHNIK: 'FORD', + JAGUARCARS: 'JAGUAR', + MICROCOMPACTCARSMART: 'SMART', + MICROCOMPACTCAR: 'SMART', + QUATTRO: 'AUDI', + AUTOMOBILILAMBORGHINIS: 'LAMBORGHINI', + AUTOMOBILILAMBORGHINI: 'LAMBORGHINI', + LUCIDMOTORS: 'LUCID', + DAIMLERCHRYSLERAG: 'CHRYSLER', + DAIMLERCHRYSLERUSA: 'CHRYSLER', + LADAVAZ: 'LADA', + WILLYSOVERLAND: 'WILLYS', + DAXCOBRA: 'DAX', + ALPINERENAULT: 'ALPINE', + AMERICANMOTORS: 'AMC', + AMERICANMOTORSCORPORATION: 'AMC', + RUFAUTOMOBILEGMBH: 'RUF', + RUFAUTOMOBILE: 'RUF', + SALEENPERFORMANCE: 'SALEEN', + TVRENGINEERINGLTD: 'TVR', + BUGATTIRIMAC: 'BUGATTI', + INEOSAUTOMOTIVE: 'INEOS', + KGMOBILITY: 'KGM' +}; +// Display names where neither source spells the brand the way it brands itself. +const MAKE_NAMES: Record = { + LYNKCO: 'Lynk & Co', + MCLAREN: 'McLaren', + LUCID: 'Lucid', + NSU: 'NSU', + DKW: 'DKW', + DAF: 'DAF', + CITROEN: 'Citroรซn', + SKODA: 'ล koda', + NIO: 'NIO', + XPENG: 'XPeng', + BYD: 'BYD', + MG: 'MG', + DS: 'DS', + KGM: 'KGM', + INEOS: 'INEOS', + AMC: 'AMC', + RUF: 'RUF', + TVR: 'TVR', + DELOREAN: 'DeLorean', + SSANGYONG: 'SsangYong', + VWPORSCHE: 'VW-Porsche', + ALPINE: 'Alpine', + SMART: 'smart', + MINI: 'MINI' +}; +const makeKey = (name: string) => { + const k = name + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .toUpperCase() + .replace(/[^A-Z0-9]/g, ''); + return MAKE_ALIASES[k] ?? k; +}; + +// Country of origin of the brand (where it was founded / is headquartered), for well-known +// brands only. Everything else stays blank rather than guessed. +const COUNTRIES: Record = Object.fromEntries( + Object.entries({ + Germany: + 'VOLKSWAGEN AUDI BMW MERCEDESBENZ PORSCHE OPEL SMART MAYBACH ALPINA WIESMANN TRABANT WARTBURG BORGWARD AUTOUNION NSU DKW GUMPERT ARTEGA CUPRA_X', + Japan: + 'TOYOTA HONDA NISSAN MAZDA SUBARU MITSUBISHI SUZUKI DAIHATSU LEXUS INFINITI ACURA ISUZU SCION DATSUN', + 'United States': + 'FORD CHEVROLET DODGE CHRYSLER JEEP CADILLAC BUICK GMC LINCOLN TESLA RAM PONTIAC OLDSMOBILE PLYMOUTH MERCURY SATURN HUMMER RIVIAN LUCID FISKER SALEEN SHELBY ROUSH EAGLE AMC GEO HENNESSEY KARMA VECTOR PANOZ STUDEBAKER', + Italy: + 'FIAT FERRARI LAMBORGHINI MASERATI ALFAROMEO LANCIA ABARTH PAGANI DETOMASO AUTOBIANCHI INNOCENTI', + France: + 'PEUGEOT RENAULT CITROEN DS ALPINE BUGATTI SIMCA TALBOT VENTURI MATRA AIXAM LIGIER MICROCAR CHATENET', + 'United Kingdom': + 'JAGUAR LANDROVER MINI ROLLSROYCE BENTLEY ASTONMARTIN LOTUS MCLAREN MG ROVER TRIUMPH MORGAN AUSTIN MORRIS CATERHAM TVR NOBLE ARIELA VAUXHALL DAIMLER JENSEN HILLMAN SUNBEAM LEYLAND AUSTINHEALEY RANGEROVER', + Sweden: 'VOLVO SAAB POLESTAR KOENIGSEGG', + 'South Korea': 'HYUNDAI KIA GENESIS DAEWOO SSANGYONG KGM', + China: + 'BYD NIO XPENG LEAPMOTOR GEELY LYNKCO ZEEKR GWM ORA WEY AIWAYS SERES VOYAH HONGQI MAXUS DONGFENG JAC CHERY OMODA JAECOO XIAOMI ZHIDOU BAIC SKYWELL DFSK FORTHING', + 'Czech Republic': 'SKODA TATRA', + Spain: 'SEAT CUPRA', + Romania: 'DACIA', + Netherlands: 'DAF SPYKER DONKERVOORT LIGHTYEAR', + Russia: 'LADA', + India: 'TATA MAHINDRA', + Vietnam: 'VINFAST', + Malaysia: 'PROTON', + Croatia: 'RIMAC' + }).flatMap(([country, keys]) => keys.split(' ').map((k) => [k, country])) +); + +const TRIM_WORDS = new Set( + `GTI GTD GTE GTX GT GTS GL GLS GLX GLI GX GXL XR XE XL XLI XLT XS XT DX LX EX SE SX SL SLX LS LT LTZ ST RS S + CABRIOLET CABRIO CABR CONVERTIBLE ROADSTER SPIDER SPYDER COUPE COUPร‰ TARGA VARIANT AVANT SPORTBACK SPORTSBACK ESTATE + HATCHBACK HB SEDAN SALOON NOTCHBACK LIMOUSINE STATION STATIONWAGON SW WAGON TOURER SPORTS TOURING TOURISMO BREAK + KOMBI CARAVAN COMBI LIFTBACK FASTBACK GRANDCOUPE AUTOMAAT AUTOMATIC AUTOMATIK AUT AUTO DIESEL HYBRID HYBRIDE ELECTRIC + ELECTRIQUE ELEKTRISCH PHEV EHYBRID EV TURBO TDI TSI TFSI FSI HDI DCI CDI CRDI JTD JTDM TDCI ECOBOOST VTEC IDI BLUEHDI + BLUEMOTION KW PK CV DRS DEURS DEUR DOOR DOORS SPECIAL EDITION LIMITED EXECUTIVE COMFORT COMFORTLINE TRENDLINE HIGHLINE + BUSINESS PREMIUM LUXURY ELEGANCE AMBIENTE TITANIUM TREND ACTIVE STYLE SPORTLINE LINE PURE PLUS PRO MAX ACCENT + AMBITION ALLURE ACCESS EXPRESSION ESSENTIA ESSENTIAL INTENS ZEN LIFE ICON FUN BASE STANDARD DELUXE DL GLE CL CLX + INJECTION ETECH PLUGIN HYBRID4 XDRIVE SDRIVE EDRIVE QUATTRO MOTION MATIC AWD WD X`.split(/\s+/) +); +const KEEP_UPPER = new Set( + 'GTI GTD GTE GTX GT AMG SUV MPV RS ST EV BEV PHEV TDI TSI SRT SS SVR SVT XL XLT CC SW TT GTS GTV RV CR-V HR-V EQA EQB EQC EQE EQS EQV EQT UX NX RX LX GX IS ES LS LC RC'.split( + ' ' + ) +); +function titleCase(s: string): string { + return s + .toLowerCase() + .split(/(\s+|-)/) + .map((w) => { + const up = w.toUpperCase(); + if (/\d/.test(w) || (w.length <= 3 && /^[^aeiouy]+$/.test(w)) || KEEP_UPPER.has(up)) + return up; + return w.charAt(0).toUpperCase() + w.slice(1); + }) + .join(''); +} +const slugify = (s: string) => + s + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .toLowerCase() + .replace(/&/g, ' and ') + .replace(/[^a-z0-9]+/g, '-') + .replace(/^-|-$/g, '') || 'x'; +const cmpKey = (s: string) => s.toUpperCase().replace(/[^A-Z0-9]/g, ''); + +/** RDW trade name -> cleaned upper-case name ("TOYOTA AYGO; 1.0" -> "AYGO"). */ +function cleanTradeName(raw: string, make: string): string { + let s = raw + .toUpperCase() + .replace(/[;,(].*$/, '') + .replace(/\s+/g, ' ') + .trim(); + const makeWords = new Set([ + ...make.split(/[\s-]+/), + make.replace(/[\s-]+/g, ''), + ...(makeKey(make) === 'VOLKSWAGEN' ? ['VW'] : []), + ...(makeKey(make) === 'MERCEDESBENZ' ? ['MERCEDES', 'BENZ', 'MERCEDES-BENZ', 'MB'] : []) + ]); + for (let i = 0; i < 3; i++) { + const [first, ...rest] = s.split(' '); + if (rest.length && makeWords.has(first)) s = rest.join(' '); + else if (s.startsWith(`${make} `) && s.length > make.length + 1) s = s.slice(make.length + 1); + else break; + } + s = s.replace(/^\d{5,}\s+/, ''); // leading RDW type code, e.g. "155221 GOLF CABRIOLET" + return s.replace(/[-\s]+$/, '').trim(); +} + +/** Brand-specific folding of engine-coded names into the model family. */ +function familyRule(makeK: string, name: string): string | null { + if (makeK === 'MERCEDESBENZ') { + if (/^(MERCEDES-)?AMG GT\b/.test(name)) return 'AMG GT'; + name = name.replace(/^(MERCEDES-)?AMG /, ''); + const m = name.match( + /^(A|B|C|E|S|G|V|R|X|CL|CLA|CLC|CLK|CLS|GL|GLA|GLB|GLC|GLE|GLK|GLS|ML|SL|SLC|SLK)[ -]?\d{2,3}/ + ); + if (m) return m[1] === 'ML' ? 'M-CLASS' : `${m[1]}-CLASS`; + const k = name.match(/^([A-Z]{1,3})[ -]KLASSE\b/); + if (k) return `${k[1]}-CLASS`; + const eq = name.match(/^(EQ[A-Z])\b/); + if (eq) return eq[1]; + } + if (makeK === 'BMW') { + const reihe = name.match(/^([1-8])(ER| SERIES| REIHE|-SERIE)/); + if (reihe) return `${reihe[1]} SERIES`; + const m = name.match(/^([1-8])\d{2} ?[A-Z]{1,3}\b/); + if (m) return `${m[1]} SERIES`; + } + if (makeK === 'OPEL') { + // Opel generation letters: Corsa-B, Astra-G-CC, Meriva-A -> Corsa, Astra, Meriva + const g = name.match(/^([A-Z]{3,})-[A-K](\b|-)/); + if (g) return g[1]; + } + return null; +} + +// Consumer body type from the RDW body (inrichting) and the EPA size class. +const RDW_BODY: Record = { + hatchback: 'hatchback', + stationwagen: 'wagon', + MPV: 'mpv', + sedan: 'sedan', + cabriolet: 'convertible', + coupe: 'coupe', + terreinvoertuig: 'suv', + limousine: 'sedan', + 'pick-up truck': 'pickup', + truckstationwagen: 'suv' +}; +function feBody(vclass: string): string { + const v = vclass.toLowerCase(); + if (v.includes('pickup')) return 'pickup'; + if (v.includes('sport utility') || v.includes('special purpose')) return 'suv'; + if (v.includes('minivan')) return 'mpv'; + if (v.includes('van')) return 'van'; + if (v.includes('wagon')) return 'wagon'; + if (v.includes('two seater')) return 'sports'; + return 'car'; +} +const feSizeClass = (vclass: string) => + vclass + .replace(/\s*[-/]?\s*(2|4)wd$/i, '') + .replace(/ - $/, '') + .replace(/Sport Utility Vehicles?/, 'SUV') + .replace('Special Purpose Vehicles', 'Special Purpose Vehicle') + .replace('Vans Passenger', 'Vans, Passenger Type') + .trim(); +function feFuel(r: Record): string[] { + const atv = r.atvType; + const f = r.fuelType; + if (atv === 'EV' || f === 'Electricity') return ['electric']; + if (atv === 'Plug-in Hybrid' || /Electricity/.test(f)) return ['plug-in hybrid']; + if (atv === 'Hybrid') return ['hybrid']; + if (f === 'Diesel') return ['diesel']; + if (f === 'CNG') return ['cng']; + if (f === 'Hydrogen') return ['hydrogen']; + if (/propane/.test(f)) return ['petrol', 'lpg']; + if (/natural gas/.test(f)) return ['petrol', 'cng']; + return ['petrol']; +} +const FE_DRIVE: Record = { + 'Front-Wheel Drive': 'fwd', + 'Rear-Wheel Drive': 'rwd', + 'All-Wheel Drive': 'awd', + '4-Wheel or All-Wheel Drive': 'awd', + '4-Wheel Drive': '4wd', + 'Part-time 4-Wheel Drive': '4wd' +}; +const feTrans = (t: string) => + /^Auto/.test(t) ? 'automatic' : /^Manual/.test(t) ? 'manual' : null; +const num = (v: string | undefined) => { + if (v == null || v === '') return null; + const n = Number(v); + return Number.isFinite(n) ? n : null; +}; + +// ---------------------------------------------------------------- building + +type Model = { + makeK: string; + key: string; // cmpKey of the family name + name: string; + usNames: Set; + years: Set; + usYears: Set; + bodies: Map; + sizeClasses: Set; + fuels: Map; + drives: Set; + trans: Set; + engine: number[]; + cyl: number[]; + turbo: boolean; + kw: number[]; + l100: number[]; + co2: number[]; + mpg: number[]; + rangeMi: number[]; + nlCount: number; + nlPriceSum: number; + nlPriceN: number; + nlMassSum: number; + nlMassN: number; + seatsSum: number; + doorsSum: number; + seatN: number; + nlYears: Map; + nlNames: Map; + variants: Record[]; + sources: Set; +}; +type Brand = { + key: string; + name: string; + usName: string | null; + nlCount: number; + models: Map; + sources: Set; +}; + +function build(src: Awaited>, fuel: RdwFuel[]) { + const brands = new Map(); + const brand = (rawName: string, us: boolean) => { + const key = makeKey(rawName); + let b = brands.get(key); + if (!b) { + b = { key, name: rawName, usName: null, nlCount: 0, models: new Map(), sources: new Set() }; + brands.set(key, b); + } + if (us && !b.usName) b.usName = rawName; + return b; + }; + const model = (b: Brand, key: string, name: string): Model => { + let m = b.models.get(key); + if (!m) { + m = { + makeK: b.key, + key, + name, + usNames: new Set(), + years: new Set(), + usYears: new Set(), + bodies: new Map(), + sizeClasses: new Set(), + fuels: new Map(), + drives: new Set(), + trans: new Set(), + engine: [], + cyl: [], + turbo: false, + kw: [], + l100: [], + co2: [], + mpg: [], + rangeMi: [], + nlCount: 0, + nlPriceSum: 0, + nlPriceN: 0, + nlMassSum: 0, + nlMassN: 0, + seatsSum: 0, + doorsSum: 0, + seatN: 0, + nlYears: new Map(), + nlNames: new Map(), + variants: [], + sources: new Set() + }; + b.models.set(key, m); + } + return m; + }; + const bump = (map: Map, k: K, n = 1) => map.set(k, (map.get(k) ?? 0) + n); + + // 1. US EPA: base model = family. + for (const r of src.fe) { + const year = Number(r.year); + if (!r.make || !r.baseModel || !year || r.baseModel === 'Postal Vehicle') continue; + const b = brand(r.make, true); + b.sources.add(SRC_FE); + const family = r.baseModel.split('/')[0].trim() || r.baseModel; + const m = model(b, cmpKey(family), family); + m.sources.add(SRC_FE); + m.usNames.add(r.model); + m.years.add(year); + m.usYears.add(year); + bump(m.bodies, feBody(r.VClass)); + if (r.VClass) m.sizeClasses.add(feSizeClass(r.VClass)); + for (const f of feFuel(r)) bump(m.fuels, f); + if (FE_DRIVE[r.drive]) m.drives.add(FE_DRIVE[r.drive]); + const t = feTrans(r.trany); + if (t) m.trans.add(t); + const displ = num(r.displ); + const cyl = num(r.cylinders); + if (displ) m.engine.push(displ); + if (cyl) m.cyl.push(cyl); + if (r.tCharger === 'T' || r.sCharger === 'S') m.turbo = true; + const comb = num(r.comb08); + if (comb) m.mpg.push(comb); + const range = num(r.range); + if (range) m.rangeMi.push(range); + m.variants.push({ + sourceId: num(r.id), + year, + name: r.model, + engineL: displ, + cylinders: cyl, + transmission: r.trany || null, + drive: r.drive || null, + fuel: r.fuelType || null, + sizeClass: r.VClass || null, + mpgCity: num(r.city08), + mpgHwy: num(r.highway08), + mpgComb: comb, + co2Gpm: (() => { + const c = num(r.co2TailpipeGpm); + return c && c > 0 ? Math.round(c) : null; + })(), + rangeMi: range || null, + evMotor: r.evMotor || null, + turbo: r.tCharger === 'T', + supercharged: r.sCharger === 'S' + }); + } + + // 2. RDW: fold trade names into families. + const makeTotals = new Map(); + for (const r of src.models) bump(makeTotals, makeKey(r.merk), Number(r.n)); + const fuelByPlate = new Map(); + for (const f of fuel) fuelByPlate.set(f.kenteken, [...(fuelByPlate.get(f.kenteken) ?? []), f]); + const yearsByName = new Map(); + for (const y of src.years) { + const k = `${y.merk}|${y.handelsbenaming ?? ''}`; + yearsByName.set(k, [...(yearsByName.get(k) ?? []), y]); + } + const bodiesByName = new Map(); + for (const y of src.bodies) { + const k = `${y.merk}|${y.handelsbenaming ?? ''}`; + bodiesByName.set(k, [...(bodiesByName.get(k) ?? []), y]); + } + + // Candidate families per make: US base models + RDW names that stand on their own. + type Row = RdwModel & { clean: string; makeK: string }; + const rows: Row[] = []; + for (const r of src.models) { + const mk = makeKey(r.merk); + if (!r.handelsbenaming || /^(ONBEKEND|NIET|UNKNOWN|-|\?)/i.test(r.handelsbenaming)) continue; + if (!brands.has(mk) && (makeTotals.get(mk) ?? 0) < MIN_NL_MAKE) continue; + if (/^(ONBEKEND|DIVERSEN|ZELFBOUW|KIT ?CAR|EIGENBOUW)/.test(mk)) continue; + const clean = cleanTradeName(r.handelsbenaming, r.merk.toUpperCase()); + if (!clean || !/[A-Z0-9]/.test(clean) || clean.includes('*') || /^\d{5,}$/.test(clean)) + continue; + rows.push({ ...r, clean, makeK: mk }); + } + // A trade name folds into a shorter family name when what follows is trim, body, engine + // or code noise ("205 GTI 1.9 U9" -> 205, "Astra Sports Tourer" -> Astra) but not when it + // names a different car ("Yaris Cross", "Corolla Verso" stay their own model). + const isNoise = (w: string) => + /[\d./]/.test(w) || w.length === 1 || TRIM_WORDS.has(w.replace(/[^A-Z]/g, '')); + // Words up to the first noise word: "IX1 EDRIVE20" -> "IX1", "ID.7 TOURER PRO" -> "ID.7". + const core = (clean: string) => { + const words = clean.split(' '); + let i = 1; + while (i < words.length && !isNoise(words[i])) i++; + return words.slice(0, i).join(' '); + }; + const candidates = new Map>(); // makeK -> cmpKey -> display upper name + const addCandidate = (mk: string, name: string) => { + const map = candidates.get(mk) ?? new Map(); + candidates.set(mk, map); + if (!map.has(cmpKey(name))) map.set(cmpKey(name), name.toUpperCase()); + }; + for (const b of brands.values()) for (const m of b.models.values()) addCandidate(b.key, m.name); + const cleanTotals = new Map(); + for (const r of rows) + bump(cleanTotals, `${r.makeK}|${familyRule(r.makeK, r.clean) ?? core(r.clean)}`, Number(r.n)); + for (const [k, n] of cleanTotals) { + if (n < MIN_NL_FAMILY) continue; + const [mk, name] = k.split('|'); + addCandidate(mk, name); + } + function familyOf(mk: string, clean: string): string | null { + const ruled = familyRule(mk, clean); + if (ruled) { + addCandidate(mk, ruled); + return ruled; + } + const cands = candidates.get(mk); + if (!cands) return null; + const words = clean.split(' '); + for (let i = 1; i < words.length; i++) { + const hit = cands.get(cmpKey(words.slice(0, i).join(' '))); + if (hit && isNoise(words[i])) return hit; + } + return cands.get(cmpKey(clean)) ?? cands.get(cmpKey(core(clean))) ?? null; + } + + const plateInfo = (plate: string) => { + const rowsF = fuelByPlate.get(plate) ?? []; + const kinds = new Set(rowsF.map((f) => f.brandstof_omschrijving)); + const cls = rowsF.find( + (f) => f.klasse_hybride_elektrisch_voertuig + )?.klasse_hybride_elektrisch_voertuig; + let fuel: string | null = null; + if (kinds.has('Waterstof')) fuel = 'hydrogen'; + else if (cls?.startsWith('OVC')) fuel = 'plug-in hybrid'; + else if (cls?.startsWith('NOVC')) fuel = 'hybrid'; + else if (kinds.has('Elektriciteit') && kinds.size > 1) fuel = 'hybrid'; + else if (kinds.has('Elektriciteit')) fuel = 'electric'; + else if (kinds.has('Diesel')) fuel = 'diesel'; + else if (kinds.has('LPG')) fuel = 'lpg'; + else if (kinds.has('CNG')) fuel = 'cng'; + else if (kinds.has('Benzine')) fuel = 'petrol'; + const kw = Math.max(0, ...rowsF.map((f) => num(f.nettomaximumvermogen) ?? 0)) || null; + const l100 = + rowsF + .map( + (f) => + num(f.brandstof_verbruik_gecombineerd_wltp) ?? num(f.brandstofverbruik_gecombineerd) + ) + .find((v) => v && v > 0 && v < 40) ?? null; + const co2 = + rowsF + .map((f) => num(f.emissie_co2_gecombineerd_wltp) ?? num(f.co2_uitstoot_gecombineerd)) + .find((v) => v != null && v >= 0 && v < 1000) ?? null; + return { fuel, kw, l100, co2 }; + }; + + const thisYear = new Date().getFullYear(); + for (const r of rows) { + const n = Number(r.n); + let fam = familyOf(r.makeK, r.clean); + if (!fam) { + if (n < MIN_NL_FAMILY) continue; + fam = core(r.clean); + } + const b = brand(r.merk, false); + const famKey = cmpKey(fam); + const existing = b.models.get(famKey); + const m = existing ?? model(b, famKey, titleCase(fam)); + b.sources.add(SRC_RDW); + b.nlCount += n; + m.sources.add(SRC_RDW); + m.nlCount += n; + bump(m.nlNames, titleCase(r.clean), n); + const price = num(r.price); + if (price && price > 1000) { + // avg over registrations that have a price; weight by count as an approximation + m.nlPriceSum += price * n; + m.nlPriceN += n; + } + const mass = num(r.mass); + if (mass && mass > 300) { + m.nlMassSum += mass * n; + m.nlMassN += n; + } + const cc = num(r.cc); + if (cc && cc > 300) m.engine.push(Math.round(cc / 100) / 10); + const name = `${r.merk}|${r.handelsbenaming}`; + for (const y of yearsByName.get(name) ?? []) { + const year = Number(y.y); + if (!year || year < 1900 || year > thisYear) continue; + const yn = Number(y.n); + const e = m.nlYears.get(year) ?? { n: 0, pSum: 0, pN: 0 }; + e.n += yn; + const p = num(y.p); + if (p && p > 1000) { + e.pSum += p * yn; + e.pN += yn; + } + m.nlYears.set(year, e); + if (y.k) { + const info = plateInfo(y.k); + if (info.fuel) bump(m.fuels, info.fuel, yn); + if (info.kw) m.kw.push(info.kw); + if (info.l100) m.l100.push(info.l100); + if (info.co2 != null) m.co2.push(info.co2); + } + } + for (const bd of bodiesByName.get(name) ?? []) { + const bn = Number(bd.n); + const body = bd.inrichting ? RDW_BODY[bd.inrichting] : undefined; + if (body) bump(m.bodies, body, bn); + const seats = num(bd.seats); + const doors = num(bd.doors); + if (seats && doors) { + m.seatsSum += seats * bn; + m.doorsSum += doors * bn; + m.seatN += bn; + } + } + } + + // 3. Finalise. + const out = []; + for (const b of brands.values()) { + const name = MAKE_NAMES[b.key] ?? b.usName ?? titleCase(b.name); + const models = []; + for (const m of b.models.values()) { + const nlYearList = [...m.nlYears.entries()] + .sort((a, c) => a[0] - c[0]) + .map(([y, e]) => ({ y, n: e.n, price: e.pN ? Math.round(e.pSum / e.pN) : null })); + const nlFirst = nlYearList[0]?.y ?? null; + const nlLast = nlYearList.at(-1)?.y ?? null; + const years = [...m.years, ...(nlFirst ? [nlFirst] : []), ...(nlLast ? [nlLast] : [])]; + if (!years.length && !m.nlCount) continue; + const latestPrice = nlYearList.filter((y) => y.price).at(-1); + const minMax = (xs: number[]) => + xs.length ? [Math.min(...xs), Math.max(...xs)] : [null, null]; + const fuelTotal = [...m.fuels.values()].reduce((a, c) => a + c, 0); + const bodyTotal = [...m.bodies.values()].reduce((a, c) => a + c, 0); + // A fuel/body seen on under 1% of the samples is usually a conversion or data error. + const fuels = [...m.fuels.entries()] + .filter(([, n]) => n / fuelTotal >= 0.01) + .sort((a, c) => c[1] - a[1]) + .map(([f]) => f); + const bodies = [...m.bodies.entries()] + .filter(([k, n]) => k !== 'car' && n / bodyTotal >= 0.03) + .sort((a, c) => c[1] - a[1]) + .map(([k]) => k); + const [eMin, eMax] = minMax(m.engine); + const [cMin, cMax] = minMax(m.cyl); + const [kMin, kMax] = minMax(m.kw); + const [lMin, lMax] = minMax(m.l100); + const [coMin, coMax] = minMax(m.co2); + const [mMin, mMax] = minMax(m.mpg); + const displayName = m.usNames.size ? m.name : m.name; + models.push({ + slug: slugify(displayName), + name: displayName, + search: [name, displayName, ...m.nlNames.keys(), ...[...m.usNames].slice(0, 40)] + .join(' ') + .toLowerCase() + .slice(0, 4000), + firstYear: Math.min(...years), + lastYear: Math.max(...years), + bodies, + sizeClasses: [...m.sizeClasses].sort(), + fuels, + drives: [...m.drives].sort(), + transmissions: [...m.trans].sort(), + engineLMin: eMin, + engineLMax: eMax, + cylindersMin: cMin, + cylindersMax: cMax, + turbo: m.usYears.size ? m.turbo : null, + powerKwMin: kMin, + powerKwMax: kMax, + l100Min: lMin, + l100Max: lMax, + co2Min: coMin == null ? null : Math.round(coMin), + co2Max: coMax == null ? null : Math.round(coMax), + mpgMin: mMin, + mpgMax: mMax, + rangeKmMax: m.rangeMi.length ? Math.round(Math.max(...m.rangeMi) * 1.609344) : null, + seats: m.seatN ? Math.round(m.seatsSum / m.seatN) : null, + doors: m.seatN ? Math.round(m.doorsSum / m.seatN) : null, + massKg: m.nlMassN ? Math.round(m.nlMassSum / m.nlMassN) : null, + nlCount: m.nlCount, + nlFirstYear: nlFirst, + nlLastYear: nlLast, + nlPrice: m.nlPriceN ? Math.round(m.nlPriceSum / m.nlPriceN) : null, + nlPriceLatest: latestPrice?.price ?? null, + nlPriceLatestYear: latestPrice?.y ?? null, + nlYears: nlYearList, + nlNames: [...m.nlNames.entries()] + .sort((a, c) => c[1] - a[1]) + .slice(0, 30) + .map(([nm, n]) => ({ name: nm, n })), + usYears: [...m.usYears].sort((a, c) => a - c), + variants: m.variants, + sources: [...m.sources].sort() + }); + } + if (!models.length) continue; + // Same slug twice in a brand (e.g. "C-MAX" vs "C MAX" already folded; rare leftovers). + const seen = new Map(); + for (const m of models) { + const c = seen.get(m.slug) ?? 0; + seen.set(m.slug, c + 1); + if (c) m.slug = `${m.slug}-${c + 1}`; + } + out.push({ + slug: slugify(name), + name, + country: COUNTRIES[b.key] ?? null, + nlCount: b.nlCount, + firstYear: Math.min(...models.map((m) => m.firstYear)), + lastYear: Math.max(...models.map((m) => m.lastYear)), + sources: [...b.sources].sort(), + models + }); + } + // NL popularity rank across all models. + const ranked = out.flatMap((b) => b.models).filter((m) => m.nlCount > 0); + ranked.sort((a, c) => c.nlCount - a.nlCount); + const rank = new Map(ranked.map((m, i) => [m, i + 1])); + return out.map((b) => ({ + ...b, + models: b.models.map((m) => ({ ...m, nlRank: rank.get(m) ?? null })) + })); +} + +// ---------------------------------------------------------------- writing + +async function write(brands: ReturnType) { + const url = process.env.DB_URL; + if (!url) throw new Error('Set DB_URL (or use --dry-run)'); + const sql = postgres(url, { max: 1, connect_timeout: 10, onnotice: () => {} }); + try { + await sql.begin(async (tx) => { + const brandIds = new Map(); + for (const b of brands) { + const [row] = await tx` + insert into cars.brands (slug, name, country, model_count, nl_count, first_year, last_year, sources) + values (${b.slug}, ${b.name}, ${b.country}, ${b.models.length}, ${b.nlCount}, ${b.firstYear}, ${b.lastYear}, ${b.sources}) + on conflict (slug) do update set name = excluded.name, country = excluded.country, + model_count = excluded.model_count, nl_count = excluded.nl_count, first_year = excluded.first_year, + last_year = excluded.last_year, sources = excluded.sources + returning id`; + brandIds.set(b.slug, row.id); + } + await tx`delete from cars.brands where slug <> all(${[...brandIds.keys()]})`; + + // Keep Dex numbers: existing (brand, slug) keep theirs; new models are numbered after + // the current maximum, oldest first. + const existing = await tx<{ id: number; dex: number; brand_id: number; slug: string }[]>` + select id, dex, brand_id, slug from cars.models`; + const byKey = new Map(existing.map((e) => [`${e.brand_id}|${e.slug}`, e])); + let nextDex = Math.max(0, ...existing.map((e) => e.dex)) + 1; + const all = brands + .flatMap((b) => b.models.map((m) => ({ b, m, brandId: brandIds.get(b.slug)! }))) + .sort( + (x, y) => + x.m.firstYear - y.m.firstYear || + x.b.name.localeCompare(y.b.name) || + x.m.name.localeCompare(y.m.name) + ); + const keep: number[] = []; + // Park existing dex numbers out of the way while rows are rewritten (unique index). + await tx`update cars.models set dex = -dex`; + await tx`delete from cars.variants`; + let variantCount = 0; + for (const { m, brandId } of all) { + const prev = byKey.get(`${brandId}|${m.slug}`); + const dex = prev?.dex ?? nextDex++; + const { variants, ...cols } = m; + const row = { + dex, + brand_id: brandId, + slug: cols.slug, + name: cols.name, + search: cols.search, + first_year: cols.firstYear, + last_year: cols.lastYear, + bodies: cols.bodies, + size_classes: cols.sizeClasses, + fuels: cols.fuels, + drives: cols.drives, + transmissions: cols.transmissions, + engine_l_min: cols.engineLMin, + engine_l_max: cols.engineLMax, + cylinders_min: cols.cylindersMin, + cylinders_max: cols.cylindersMax, + turbo: cols.turbo, + power_kw_min: cols.powerKwMin, + power_kw_max: cols.powerKwMax, + l100_min: cols.l100Min, + l100_max: cols.l100Max, + co2_min: cols.co2Min, + co2_max: cols.co2Max, + mpg_min: cols.mpgMin, + mpg_max: cols.mpgMax, + range_km_max: cols.rangeKmMax, + seats: cols.seats, + doors: cols.doors, + mass_kg: cols.massKg, + nl_count: cols.nlCount, + nl_rank: cols.nlRank, + nl_first_year: cols.nlFirstYear, + nl_last_year: cols.nlLastYear, + nl_price: cols.nlPrice, + nl_price_latest: cols.nlPriceLatest, + nl_price_latest_year: cols.nlPriceLatestYear, + nl_years: tx.json(cols.nlYears), + nl_names: tx.json(cols.nlNames), + us_years: cols.usYears, + variant_count: variants.length, + sources: cols.sources + }; + const [saved] = await tx` + insert into cars.models ${tx(row)} + on conflict (brand_id, slug) do update set ${tx(row, Object.keys(row).filter((k) => k !== 'brand_id' && k !== 'slug') as (keyof typeof row)[])} + returning id`; + keep.push(saved.id); + for (let i = 0; i < variants.length; i += 500) { + const chunk = variants.slice(i, i + 500).map((v) => ({ + model_id: saved.id, + source_id: v.sourceId, + year: v.year, + name: v.name, + engine_l: v.engineL, + cylinders: v.cylinders, + transmission: v.transmission, + drive: v.drive, + fuel: v.fuel, + size_class: v.sizeClass, + mpg_city: v.mpgCity, + mpg_hwy: v.mpgHwy, + mpg_comb: v.mpgComb, + co2_gpm: v.co2Gpm, + range_mi: v.rangeMi, + ev_motor: v.evMotor, + turbo: v.turbo, + supercharged: v.supercharged + })); + await tx`insert into cars.variants ${tx(chunk)}`; + variantCount += chunk.length; + } + } + await tx`delete from cars.models where id <> all(${keep})`; + console.log(`wrote ${brands.length} brands, ${keep.length} models, ${variantCount} variants`); + }); + } finally { + await sql.end(); + } +} + +// ---------------------------------------------------------------- main + +const src = await loadSources(); +console.log( + `fueleconomy.gov rows: ${src.fe.length}; RDW names: ${src.models.length}, years: ${src.years.length}` +); +const plates = [...new Set(src.years.map((y) => y.k).filter(Boolean))]; +const fuel = await cached('rdw-fuel.json', () => { + console.log(`querying RDW fuel data for ${plates.length} sample cars`); + return loadFuel(plates); +}); +const brands = build(src, fuel); +const models = brands.flatMap((b) => b.models); +console.log( + `built ${brands.length} brands, ${models.length} models, ${models.reduce((a, m) => a + m.variants.length, 0)} variants` +); +if (outFile) + await writeFile( + outFile, + JSON.stringify( + brands.map((b) => ({ + ...b, + models: b.models.map(({ variants, ...m }) => ({ ...m, variants: variants.length })) + })) + ) + ); +if (dryRun) { + const top = models.toSorted((a, c) => c.nlCount - a.nlCount).slice(0, 15); + for (const m of top) + console.log(` ${m.name} nl=${m.nlCount} ${m.firstYear}-${m.lastYear} ${m.fuels.join('/')}`); +} else await write(brands); diff --git a/src/lib/cars/BrandBadge.svelte b/src/lib/cars/BrandBadge.svelte new file mode 100644 index 0000000..e9ad500 --- /dev/null +++ b/src/lib/cars/BrandBadge.svelte @@ -0,0 +1,43 @@ + + + + + diff --git a/src/lib/cars/CarCard.svelte b/src/lib/cars/CarCard.svelte new file mode 100644 index 0000000..4d685b6 --- /dev/null +++ b/src/lib/cars/CarCard.svelte @@ -0,0 +1,125 @@ + + + +
+ + {dexLabel(car.dex)} +
+
+

{car.brandName}

+

{car.name}

+

+ {years(car.firstYear, car.lastYear, current) ?? 'โ€”'}{#if car.bodies[0]} + ยท {bodyLabel[car.bodies[0]] ?? car.bodies[0]}{/if} +

+
+
+ {#each car.fuels.slice(0, 3) as fuel (fuel)}{/each} +
+
+
+
๐Ÿ‡ณ๐Ÿ‡ฑ on the road
+
{car.nlCount ? fmtCompact(car.nlCount) : 'โ€”'}
+
+
+
max power
+
{car.powerKwMax ? `${kwToHp(car.powerKwMax)} hp` : 'โ€”'}
+
+
+
new price
+
{car.nlPriceLatest ? fmtEuro(car.nlPriceLatest) : 'โ€”'}
+
+
+
+ + diff --git a/src/lib/cars/FuelChip.svelte b/src/lib/cars/FuelChip.svelte new file mode 100644 index 0000000..cc2ea01 --- /dev/null +++ b/src/lib/cars/FuelChip.svelte @@ -0,0 +1,63 @@ + + +{fuelLabel[fuel] ?? fuel} + + diff --git a/src/lib/cars/shared.ts b/src/lib/cars/shared.ts new file mode 100644 index 0000000..9b37ce2 --- /dev/null +++ b/src/lib/cars/shared.ts @@ -0,0 +1,167 @@ +// Shared (client + server) labels and helpers for the car pokedex (/trackers/cars). + +export const FUELS = [ + 'petrol', + 'diesel', + 'hybrid', + 'plug-in hybrid', + 'electric', + 'lpg', + 'cng', + 'hydrogen' +] as const; +export const BODIES = [ + 'hatchback', + 'sedan', + 'wagon', + 'suv', + 'mpv', + 'van', + 'pickup', + 'coupe', + 'convertible', + 'sports' +] as const; +export const DRIVES = ['fwd', 'rwd', 'awd', '4wd'] as const; +export const SORTS = { + dex: 'dex #', + popular: 'most common in NL', + name: 'name', + newest: 'newest', + oldest: 'oldest', + cheap: 'cheapest new (NL)', + power: 'most powerful', + efficient: 'most efficient' +} as const; +export type CarSort = keyof typeof SORTS; + +export const fuelLabel: Record = { + petrol: 'petrol', + diesel: 'diesel', + hybrid: 'hybrid', + 'plug-in hybrid': 'plug-in', + electric: 'electric', + lpg: 'LPG', + cng: 'CNG', + hydrogen: 'hydrogen' +}; +export const driveLabel: Record = { + fwd: 'front-wheel drive', + rwd: 'rear-wheel drive', + awd: 'all-wheel drive', + '4wd': '4x4' +}; +export const bodyLabel: Record = { + hatchback: 'hatchback', + sedan: 'sedan', + wagon: 'estate / wagon', + suv: 'SUV', + mpv: 'MPV', + van: 'van', + pickup: 'pickup', + coupe: 'coupรฉ', + convertible: 'convertible', + sports: 'two-seater' +}; +/** What a newcomer should know about each fuel type, one line each. */ +export const fuelHint: Record = { + petrol: 'Cheapest to buy, simple, but fuel is expensive in NL.', + diesel: 'Frugal on long trips, but NL road tax is much higher and city bans are growing.', + hybrid: 'Petrol engine + small battery that charges itself. Great for city driving.', + 'plug-in hybrid': 'Bigger battery you charge from a plug; short trips can be fully electric.', + electric: + 'Battery only: cheapest per km and quiet, but you need somewhere to charge. NL road-tax discounts are shrinking.', + lpg: 'Runs on autogas (cheap fuel) via a conversion; extra road tax in NL.', + cng: 'Runs on compressed natural gas; very few fuel stations in NL.', + hydrogen: 'Fuel cell car; only a handful of hydrogen stations in NL.' +}; + +const FLAGS: Record = { + Germany: '๐Ÿ‡ฉ๐Ÿ‡ช', + Japan: '๐Ÿ‡ฏ๐Ÿ‡ต', + 'United States': '๐Ÿ‡บ๐Ÿ‡ธ', + Italy: '๐Ÿ‡ฎ๐Ÿ‡น', + France: '๐Ÿ‡ซ๐Ÿ‡ท', + 'United Kingdom': '๐Ÿ‡ฌ๐Ÿ‡ง', + Sweden: '๐Ÿ‡ธ๐Ÿ‡ช', + 'South Korea': '๐Ÿ‡ฐ๐Ÿ‡ท', + China: '๐Ÿ‡จ๐Ÿ‡ณ', + 'Czech Republic': '๐Ÿ‡จ๐Ÿ‡ฟ', + Spain: '๐Ÿ‡ช๐Ÿ‡ธ', + Romania: '๐Ÿ‡ท๐Ÿ‡ด', + Netherlands: '๐Ÿ‡ณ๐Ÿ‡ฑ', + Russia: '๐Ÿ‡ท๐Ÿ‡บ', + India: '๐Ÿ‡ฎ๐Ÿ‡ณ', + Vietnam: '๐Ÿ‡ป๐Ÿ‡ณ', + Malaysia: '๐Ÿ‡ฒ๐Ÿ‡พ', + Croatia: '๐Ÿ‡ญ๐Ÿ‡ท' +}; +export const flag = (country: string | null) => (country ? (FLAGS[country] ?? '') : ''); + +export const dexLabel = (dex: number) => `#${String(dex).padStart(4, '0')}`; + +/** Two-letter monogram for a brand badge ("Mercedes-Benz" -> "MB", "Toyota" -> "TO"). */ +export function monogram(name: string): string { + const words = name + .replace(/&/g, ' ') + .split(/[\s-]+/) + .filter((w) => /[A-Za-z0-9]/.test(w)); + if (words.length >= 2) return (words[0][0] + words[1][0]).toUpperCase(); + return name + .replace(/[^A-Za-z0-9]/g, '') + .slice(0, 2) + .toUpperCase(); +} + +/** Stable hue per brand so each badge keeps its colour. */ +export function brandHue(name: string): number { + let h = 0; + for (const c of name) h = (h * 31 + c.charCodeAt(0)) % 360; + return h; +} + +export const kwToHp = (kw: number) => Math.round(kw * 1.341); +export const mpgToL100 = (mpg: number) => 235.215 / mpg; + +const compact = new Intl.NumberFormat('en-GB', { notation: 'compact', maximumFractionDigits: 1 }); +const whole = new Intl.NumberFormat('en-GB'); +const euro = new Intl.NumberFormat('nl-NL', { + style: 'currency', + currency: 'EUR', + maximumFractionDigits: 0 +}); +export const fmtCompact = (n: number) => compact.format(n); +export const fmtNumber = (n: number) => whole.format(n); +export const fmtEuro = (n: number) => euro.format(n); + +export function range( + min: number | null, + max: number | null, + format: (n: number) => string = String +): string | null { + if (min == null && max == null) return null; + if (min == null || max == null || min === max) return format((min ?? max)!); + return `${format(min)}โ€“${format(max)}`; +} + +export const years = (first: number | null, last: number | null, current: number) => + first == null + ? null + : last == null || first === last + ? String(first) + : `${first}โ€“${last >= current ? 'now' : last}`; + +export type CarCard = { + dex: number; + slug: string; + name: string; + brandSlug: string; + brandName: string; + firstYear: number | null; + lastYear: number | null; + fuels: string[]; + bodies: string[]; + nlCount: number; + nlPriceLatest: number | null; + powerKwMax: number | null; +}; diff --git a/src/lib/projects.test.ts b/src/lib/projects.test.ts index da89cc8..d9296a8 100644 --- a/src/lib/projects.test.ts +++ b/src/lib/projects.test.ts @@ -7,13 +7,13 @@ describe('trackers', () => { visibleTrackers(true) .map((t) => t.name) .slice(0, 4) - ).toEqual(['tasks', 'money', 'books', 'health']); + ).toEqual(['tasks', 'money', 'books', 'cars']); }); it('hides private trackers when logged out', () => { const names = visibleTrackers(false).map((t) => t.name); expect(names).not.toContain('tasks'); expect(names).not.toContain('health'); - expect(names.slice(0, 2)).toEqual(['money', 'books']); + expect(names.slice(0, 3)).toEqual(['money', 'books', 'cars']); }); it('uses short single-word names', () => { for (const t of visibleTrackers(true)) expect(t.name).toMatch(/^[a-z]+$/); diff --git a/src/lib/projects.ts b/src/lib/projects.ts index 29f2cc1..81ee765 100644 --- a/src/lib/projects.ts +++ b/src/lib/projects.ts @@ -58,6 +58,13 @@ const allTrackers = [ external: false, private: false }, + { + name: 'cars', + subtitle: 'a car pokedex: every brand and model, with Dutch and US data', + href: '/trackers/cars', + external: false, + private: false + }, { name: 'health', subtitle: 'private: body, workouts, sleep, meds and vaccinations', diff --git a/src/lib/seo.ts b/src/lib/seo.ts index 314fab2..2356e0c 100644 --- a/src/lib/seo.ts +++ b/src/lib/seo.ts @@ -44,6 +44,11 @@ const publicPages: Record = { title: 'Books', description: 'Stan Rungeโ€™s library: books being read, finished and on the to-read pile.' }, + '/trackers/cars': { + title: 'Car pokedex', + description: + 'Search every car brand and model: specs, fuel types, Dutch registrations and US fuel economy.' + }, '/lists': { title: 'Lists', description: 'Lists collected and maintained by Stan Runge.' }, '/projects/game-tracker': { title: 'Game Tracker', diff --git a/src/lib/server/cars.ts b/src/lib/server/cars.ts new file mode 100644 index 0000000..30f1c9d --- /dev/null +++ b/src/lib/server/cars.ts @@ -0,0 +1,198 @@ +// Car pokedex queries (/trackers/cars). Public, read-only; data is written only by +// scripts/cars-import.ts. +import { db } from '#lib/server/db/index.js'; +import { carBrands, carModels, carVariants } from '#lib/server/db/schema/index.js'; +import { and, arrayContains, asc, desc, eq, gt, gte, ilike, lte, sql, type SQL } from 'drizzle-orm'; +import { BODIES, DRIVES, FUELS, SORTS, type CarCard, type CarSort } from '#lib/cars/shared.js'; + +export const PAGE_SIZE = 60; + +export type CarFilters = { + q: string; + brand: string; + fuel: string; + body: string; + drive: string; + market: '' | 'nl' | 'us'; + from: number | null; + to: number | null; + sort: CarSort; + page: number; +}; + +const pick = (value: string | null, allowed: readonly T[]): T | '' => + allowed.includes(value as T) ? (value as T) : ''; +const year = (value: string | null) => { + const n = Number(value); + return value && Number.isInteger(n) && n >= 1880 && n <= 2100 ? n : null; +}; + +export function parseFilters(params: URLSearchParams): CarFilters { + const sort = params.get('sort'); + return { + q: (params.get('q') ?? '').trim().slice(0, 80), + brand: (params.get('brand') ?? '').replace(/[^a-z0-9-]/g, '').slice(0, 60), + fuel: pick(params.get('fuel'), FUELS), + body: pick(params.get('body'), BODIES), + drive: pick(params.get('drive'), DRIVES), + market: pick(params.get('market'), ['nl', 'us'] as const), + from: year(params.get('from')), + to: year(params.get('to')), + sort: sort && sort in SORTS ? (sort as CarSort) : 'dex', + page: Math.min(Math.max(1, Math.floor(Number(params.get('page')) || 1)), 1000) + }; +} + +const cardColumns = { + dex: carModels.dex, + slug: carModels.slug, + name: carModels.name, + brandSlug: carBrands.slug, + brandName: carBrands.name, + firstYear: carModels.firstYear, + lastYear: carModels.lastYear, + fuels: carModels.fuels, + bodies: carModels.bodies, + nlCount: carModels.nlCount, + nlPriceLatest: carModels.nlPriceLatest, + powerKwMax: carModels.powerKwMax +}; + +const escapeLike = (s: string) => s.replace(/[\\%_]/g, (c) => `\\${c}`); + +export async function searchCars(f: CarFilters): Promise<{ cars: CarCard[]; total: number }> { + const where: SQL[] = []; + for (const word of f.q.toLowerCase().split(/\s+/).filter(Boolean).slice(0, 6)) + where.push(ilike(carModels.search, `%${escapeLike(word)}%`)); + if (f.brand) where.push(eq(carBrands.slug, f.brand)); + if (f.fuel) where.push(arrayContains(carModels.fuels, [f.fuel])); + if (f.body) where.push(arrayContains(carModels.bodies, [f.body])); + if (f.drive) where.push(arrayContains(carModels.drives, [f.drive])); + if (f.market === 'nl') where.push(gt(carModels.nlCount, 0)); + if (f.market === 'us') where.push(gt(carModels.variantCount, 0)); + if (f.from) where.push(gte(carModels.lastYear, f.from)); + if (f.to) where.push(lte(carModels.firstYear, f.to)); + const order = { + dex: [asc(carModels.dex)], + popular: [desc(carModels.nlCount), asc(carModels.dex)], + name: [asc(carModels.name), asc(carBrands.name)], + newest: [desc(carModels.lastYear), desc(carModels.firstYear), desc(carModels.nlCount)], + oldest: [asc(carModels.firstYear), asc(carModels.dex)], + cheap: [sql`${carModels.nlPriceLatest} asc nulls last`, desc(carModels.nlCount)], + power: [sql`${carModels.powerKwMax} desc nulls last`, asc(carModels.dex)], + efficient: [sql`${carModels.co2Min} asc nulls last`, desc(carModels.nlCount)] + }[f.sort]; + const condition = where.length ? and(...where) : undefined; + const [cars, [{ total }]] = await Promise.all([ + db + .select(cardColumns) + .from(carModels) + .innerJoin(carBrands, eq(carBrands.id, carModels.brandId)) + .where(condition) + .orderBy(...order) + .limit(PAGE_SIZE) + .offset((f.page - 1) * PAGE_SIZE), + db + .select({ total: sql`count(*)::int` }) + .from(carModels) + .innerJoin(carBrands, eq(carBrands.id, carModels.brandId)) + .where(condition) + ]); + return { cars, total }; +} + +type Overview = { + brands: { slug: string; name: string; models: number }[]; + stats: { brands: number; models: number; variants: number; nlCars: number }; +}; +let overviewCache: { at: number; value: Overview } | null = null; + +/** Brand list for the filter and headline counts; cached for 10 minutes. */ +export async function carOverview(): Promise { + if (overviewCache && Date.now() - overviewCache.at < 600_000) return overviewCache.value; + const [brands, [counts]] = await Promise.all([ + db + .select({ slug: carBrands.slug, name: carBrands.name, models: carBrands.modelCount }) + .from(carBrands) + .orderBy(asc(carBrands.name)), + db + .select({ + models: sql`count(*)::int`, + variants: sql`coalesce(sum(${carModels.variantCount}), 0)::int`, + nlCars: sql`coalesce(sum(${carModels.nlCount}), 0)::bigint` + }) + .from(carModels) + ]); + const value = { + brands, + stats: { + brands: brands.length, + models: counts.models, + variants: counts.variants, + nlCars: Number(counts.nlCars) + } + }; + overviewCache = { at: Date.now(), value }; + return value; +} + +export async function getBrand(slug: string) { + const [brand] = await db.select().from(carBrands).where(eq(carBrands.slug, slug)).limit(1); + if (!brand) return null; + const models = await db + .select(cardColumns) + .from(carModels) + .innerJoin(carBrands, eq(carBrands.id, carModels.brandId)) + .where(eq(carModels.brandId, brand.id)) + .orderBy(desc(carModels.nlCount), desc(carModels.variantCount), asc(carModels.name)); + return { brand, models }; +} + +export async function getModel(brandSlug: string, modelSlug: string) { + const [row] = await db + .select({ model: carModels, brand: carBrands }) + .from(carModels) + .innerJoin(carBrands, eq(carBrands.id, carModels.brandId)) + .where(and(eq(carBrands.slug, brandSlug), eq(carModels.slug, modelSlug))) + .limit(1); + if (!row) return null; + const [variants, neighbours] = await Promise.all([ + db + .select() + .from(carVariants) + .where(eq(carVariants.modelId, row.model.id)) + .orderBy(desc(carVariants.year), asc(carVariants.name), asc(carVariants.engineL)), + db + .select({ + dex: carModels.dex, + slug: carModels.slug, + name: carModels.name, + brandSlug: carBrands.slug + }) + .from(carModels) + .innerJoin(carBrands, eq(carBrands.id, carModels.brandId)) + .where( + sql`${carModels.dex} in ( + (select max(dex) from cars.models where dex < ${row.model.dex}), + (select min(dex) from cars.models where dex > ${row.model.dex}))` + ) + ]); + return { + ...row, + variants, + prev: neighbours.find((n) => n.dex < row.model.dex) ?? null, + next: neighbours.find((n) => n.dex > row.model.dex) ?? null + }; +} + +/** A random model, favouring cars people actually drive (in NL or EPA-tested). */ +export async function randomCar() { + const [row] = await db + .select({ slug: carModels.slug, brandSlug: carBrands.slug }) + .from(carModels) + .innerJoin(carBrands, eq(carBrands.id, carModels.brandId)) + .where(sql`${carModels.nlCount} >= 100 or ${carModels.variantCount} >= 5`) + .orderBy(sql`random()`) + .limit(1); + return row ?? null; +} diff --git a/src/lib/server/db/schema/cars.ts b/src/lib/server/db/schema/cars.ts new file mode 100644 index 0000000..f09e680 --- /dev/null +++ b/src/lib/server/db/schema/cars.ts @@ -0,0 +1,137 @@ +import { sql } from 'drizzle-orm'; +import { + boolean, + index, + integer, + jsonb, + real, + smallint, + text, + uniqueIndex +} from 'drizzle-orm/pg-core'; +import { carsSchema } from './schemas'; +import { id, timestamps } from './helpers'; + +// Public car "pokedex" (/trackers/cars). Read-only catalogue built from open data by +// scripts/cars-import.ts (re-runnable; upserts brands/models by slug so Dex numbers stay +// stable, and replaces variants). Sources: +// - fueleconomy.gov vehicles.csv (US EPA, 1984-now): one `variants` row per EPA test car. +// - RDW open data (opendata.rdw.nl, Gekentekende voertuigen + brandstof): per make/model +// aggregates of passenger cars registered in NL (count, years, list price, mass, body), +// plus fuel/power/consumption read from one sample registration per model-year. +// Unknown stays null; nothing is estimated. + +/** Shape of `models.nl_years`: registrations per first-registration year. */ +export type CarNlYear = { y: number; n: number; price: number | null }; +/** Shape of `models.nl_names`: RDW trade names (handelsbenaming) folded into this model. */ +export type CarNlName = { name: string; n: number }; + +export const carBrands = carsSchema.table( + 'brands', + { + id: id(), + slug: text('slug').notNull(), + name: text('name').notNull(), + country: text('country'), + modelCount: integer('model_count').notNull().default(0), + nlCount: integer('nl_count').notNull().default(0), + firstYear: smallint('first_year'), + lastYear: smallint('last_year'), + sources: text('sources').array().notNull().default([]), + ...timestamps + }, + (t) => [uniqueIndex('brands_slug_key').on(t.slug)] +); + +export const carModels = carsSchema.table( + 'models', + { + id: id(), + dex: integer('dex').notNull(), + brandId: integer('brand_id') + .notNull() + .references(() => carBrands.id, { onDelete: 'cascade' }), + slug: text('slug').notNull(), + name: text('name').notNull(), + /** Lowercase brand + name + trade names, for ILIKE / trigram search. */ + search: text('search').notNull(), + firstYear: smallint('first_year'), + lastYear: smallint('last_year'), + /** Consumer body types: hatchback, sedan, wagon, suv, mpv, van, pickup, coupe, convertible, sports. */ + bodies: text('bodies').array().notNull().default([]), + /** US EPA size classes (e.g. "Compact Cars", "Small SUV"). */ + sizeClasses: text('size_classes').array().notNull().default([]), + /** petrol, diesel, hybrid, plug-in hybrid, electric, lpg, cng, hydrogen. */ + fuels: text('fuels').array().notNull().default([]), + /** fwd, rwd, awd, 4wd. */ + drives: text('drives').array().notNull().default([]), + transmissions: text('transmissions').array().notNull().default([]), + engineLMin: real('engine_l_min'), + engineLMax: real('engine_l_max'), + cylindersMin: smallint('cylinders_min'), + cylindersMax: smallint('cylinders_max'), + turbo: boolean('turbo'), + powerKwMin: real('power_kw_min'), + powerKwMax: real('power_kw_max'), + /** Combined consumption, litres per 100 km (RDW type approval, NEDC or WLTP). */ + l100Min: real('l100_min'), + l100Max: real('l100_max'), + co2Min: smallint('co2_min'), // g/km (RDW) + co2Max: smallint('co2_max'), + mpgMin: real('mpg_min'), // combined (EPA; MPGe for EVs) + mpgMax: real('mpg_max'), + rangeKmMax: smallint('range_km_max'), // EV range (EPA) + seats: smallint('seats'), + doors: smallint('doors'), + massKg: smallint('mass_kg'), // NL avg kerb weight (massa rijklaar) + nlCount: integer('nl_count').notNull().default(0), + nlRank: integer('nl_rank'), + nlFirstYear: smallint('nl_first_year'), + nlLastYear: smallint('nl_last_year'), + nlPrice: integer('nl_price'), // avg catalogue price (EUR, incl. taxes) over all NL registrations + nlPriceLatest: integer('nl_price_latest'), // avg catalogue price in the latest year with data + nlPriceLatestYear: smallint('nl_price_latest_year'), + nlYears: jsonb('nl_years').$type().notNull().default([]), + nlNames: jsonb('nl_names').$type().notNull().default([]), + usYears: smallint('us_years').array().notNull().default([]), + variantCount: integer('variant_count').notNull().default(0), + sources: text('sources').array().notNull().default([]), + ...timestamps + }, + (t) => [ + uniqueIndex('models_dex_key').on(t.dex), + uniqueIndex('models_brand_slug_key').on(t.brandId, t.slug), + index('models_nl_count_idx').on(t.nlCount), + index('models_search_trgm_idx').using('gin', sql`${t.search} public.gin_trgm_ops`) + ] +); + +/** One row per fueleconomy.gov test vehicle (model-year x engine x transmission x drive). */ +export const carVariants = carsSchema.table( + 'variants', + { + id: id(), + modelId: integer('model_id') + .notNull() + .references(() => carModels.id, { onDelete: 'cascade' }), + source: text('source').notNull().default('fueleconomy.gov'), + sourceId: integer('source_id'), + year: smallint('year').notNull(), + name: text('name').notNull(), + engineL: real('engine_l'), + cylinders: smallint('cylinders'), + transmission: text('transmission'), + drive: text('drive'), + fuel: text('fuel'), + sizeClass: text('size_class'), + mpgCity: real('mpg_city'), + mpgHwy: real('mpg_hwy'), + mpgComb: real('mpg_comb'), + co2Gpm: smallint('co2_gpm'), // tailpipe g/mile + rangeMi: smallint('range_mi'), + evMotor: text('ev_motor'), + turbo: boolean('turbo').notNull().default(false), + supercharged: boolean('supercharged').notNull().default(false) + }, + (t) => [index('variants_model_year_idx').on(t.modelId, t.year)] +); diff --git a/src/lib/server/db/schema/index.ts b/src/lib/server/db/schema/index.ts index 0a57d21..78d9f9c 100644 --- a/src/lib/server/db/schema/index.ts +++ b/src/lib/server/db/schema/index.ts @@ -17,3 +17,4 @@ export * from './books'; export * from './tasks'; export * from './groceries'; export * from './home'; +export * from './cars'; diff --git a/src/lib/server/db/schema/schemas.ts b/src/lib/server/db/schema/schemas.ts index 7841e90..4449bda 100644 --- a/src/lib/server/db/schema/schemas.ts +++ b/src/lib/server/db/schema/schemas.ts @@ -17,3 +17,4 @@ export const booksSchema = pgSchema('books'); export const tasksSchema = pgSchema('tasks'); export const groceriesSchema = pgSchema('groceries'); export const homeSchema = pgSchema('home'); +export const carsSchema = pgSchema('cars'); diff --git a/src/lib/server/owner.test.ts b/src/lib/server/owner.test.ts index ef5fb69..f7796b9 100644 --- a/src/lib/server/owner.test.ts +++ b/src/lib/server/owner.test.ts @@ -39,6 +39,8 @@ describe('owner gate', () => { expect(isOwnerWritePath('/trackers/books/12')).toBe(true); expect(isOwnerWritePath('/trackers/books')).toBe(true); expect(isOwnerWritePath('/trackers/health/import')).toBe(true); + expect(isOwnerWritePath('/trackers/cars/ford/mustang')).toBe(true); + expect(isOwnerOnlyPath('/trackers/cars/ford/mustang')).toBe(false); expect(isOwnerWritePath('/trackers/bookshelf')).toBe(false); expect(isOwnerWritePath('/lists/books')).toBe(false); }); diff --git a/src/lib/server/owner.ts b/src/lib/server/owner.ts index 7d53f7a..233192e 100644 --- a/src/lib/server/owner.ts +++ b/src/lib/server/owner.ts @@ -45,7 +45,8 @@ export const ownerWritePrefixes = [ '/trackers/tasks', '/trackers/groceries', '/trackers/houses', - '/trackers/books' + '/trackers/books', + '/trackers/cars' ] as const; const normalise = (pathname: string) => pathname.toLowerCase().replace(/\/+$/, ''); diff --git a/src/lib/title.ts b/src/lib/title.ts index 828ba57..a2eb477 100644 --- a/src/lib/title.ts +++ b/src/lib/title.ts @@ -19,6 +19,7 @@ export function getTitle(path: string, environment: SiteEnvironment = null): str '/projects': 'Projects', '/trackers': 'Trackers', '/trackers/books': 'Books', + '/trackers/cars': 'Cars', '/blog': 'Blog', '/lists': 'Lists', '/login': 'Sign in', diff --git a/src/routes/sitemap.xml/+server.ts b/src/routes/sitemap.xml/+server.ts index 241e9ba..16ec189 100644 --- a/src/routes/sitemap.xml/+server.ts +++ b/src/routes/sitemap.xml/+server.ts @@ -14,6 +14,7 @@ const staticPaths = [ '/blog', '/lists', '/trackers/books', + '/trackers/cars', '/projects/game-tracker', '/projects/game-tracker/pokemon', '/projects/game-tracker/osu', diff --git a/src/routes/trackers/cars/+page.server.ts b/src/routes/trackers/cars/+page.server.ts new file mode 100644 index 0000000..0948046 --- /dev/null +++ b/src/routes/trackers/cars/+page.server.ts @@ -0,0 +1,20 @@ +import { carOverview, PAGE_SIZE, parseFilters, searchCars } from '#lib/server/cars.js'; +import type { PageServerLoad } from './$types'; + +export const load: PageServerLoad = async ({ url }) => { + const filters = parseFilters(url.searchParams); + const [{ cars, total }, overview] = await Promise.all([searchCars(filters), carOverview()]); + return { + filters, + cars, + total, + pageSize: PAGE_SIZE, + brands: overview.brands, + stats: overview.stats, + currentYear: new Date().getFullYear(), + seo: { + title: 'Car pokedex', + description: `Search ${overview.stats.models.toLocaleString('en-GB')} car models from ${overview.stats.brands} brands, with Dutch registration data and US fuel economy specs.` + } + }; +}; diff --git a/src/routes/trackers/cars/+page.svelte b/src/routes/trackers/cars/+page.svelte new file mode 100644 index 0000000..a27c77e --- /dev/null +++ b/src/routes/trackers/cars/+page.svelte @@ -0,0 +1,325 @@ + + +
+
+
+

cars

+

+ A car pokedex: every brand and model sold as a regular production car that I could find in + Dutch registrations or US fuel-economy tests. Tap one to learn what it is. +

+
+ random car +
+ +
+
+
brands
+
{fmtNumber(data.stats.brands)}
+
+
+
models
+
{fmtNumber(data.stats.models)}
+
+
+
US versions
+
{fmtNumber(data.stats.variants)}
+
+
+
cars on Dutch roads
+
{fmtCompact(data.stats.nlCars)}
+
+
+ +
+ +
+ + + {#each data.brands as b (b.slug)}{/each} + + + + {#each FUELS as x (x)}{/each} + + + + {#each BODIES as x (x)}{/each} + + + + {#each DRIVES as x (x)}{/each} + + + + + + + + + + + + + {#each Object.entries(SORTS) as [key, label] (key)}{/each} + + +
+
+ +
+ {#each quick as chip (chip.label)} + {chip.label} + {/each} + {#if filtering} + clear filters + {/if} +
+ +

+ {fmtNumber(data.total)} + {data.total === 1 ? 'model' : 'models'}{#if pages > 1} + ยท page {f.page} of {pages}{/if} +

+ + {#if data.cars.length} +
    + {#each data.cars as car (car.dex)} +
  • + {/each} +
+ {:else} +
+

No cars match that.

+

+ Try fewer words or clear the filters. +

+
+ {/if} + + {#if pages > 1} + + {/if} + +
+ Data: RDW open data (Dutch vehicle + register, CC0) and + fueleconomy.gov + (US EPA/DOE). Models are grouped from registered trade names, so a few odd splits remain. Prices are + average catalogue prices of new cars when first registered in NL. Blank means unknown. +
+
+ + diff --git a/src/routes/trackers/cars/[brand]/+page.server.ts b/src/routes/trackers/cars/[brand]/+page.server.ts new file mode 100644 index 0000000..50b179d --- /dev/null +++ b/src/routes/trackers/cars/[brand]/+page.server.ts @@ -0,0 +1,27 @@ +import { error } from '@sveltejs/kit'; +import { getBrand } from '#lib/server/cars.js'; +import type { PageServerLoad } from './$types'; + +export const load: PageServerLoad = async ({ params }) => { + const found = await getBrand(params.brand); + if (!found) error(404, 'No such brand in the car pokedex'); + const { brand, models } = found; + return { + brand: { + slug: brand.slug, + name: brand.name, + country: brand.country, + modelCount: brand.modelCount, + nlCount: brand.nlCount, + firstYear: brand.firstYear, + lastYear: brand.lastYear, + sources: brand.sources + }, + models, + currentYear: new Date().getFullYear(), + seo: { + title: `${brand.name} cars`, + description: `All ${brand.modelCount} ${brand.name} models in Stan's car pokedex${brand.country ? ` (${brand.country})` : ''}, with Dutch registrations and specs.` + } + }; +}; diff --git a/src/routes/trackers/cars/[brand]/+page.svelte b/src/routes/trackers/cars/[brand]/+page.svelte new file mode 100644 index 0000000..91edc5c --- /dev/null +++ b/src/routes/trackers/cars/[brand]/+page.svelte @@ -0,0 +1,53 @@ + + +
+ all cars +
+ +
+

{b.name}

+

+ {#if b.country}{flag(b.country)} {b.country} ยท + {/if}{fmtNumber(b.modelCount)} models{#if b.firstYear} + ยท {years(b.firstYear, b.lastYear, data.currentYear)}{/if}{#if b.nlCount} + ยท {fmtNumber(b.nlCount)} on Dutch roads{/if} +

+
+
+ +
    + {#each data.models as car (car.dex)} +
  • + {/each} +
+

+ Sorted by how many are registered in NL. Sources: {b.sources.join(', ')}. +

+
+ + diff --git a/src/routes/trackers/cars/[brand]/[model]/+page.server.ts b/src/routes/trackers/cars/[brand]/[model]/+page.server.ts new file mode 100644 index 0000000..adc1a38 --- /dev/null +++ b/src/routes/trackers/cars/[brand]/[model]/+page.server.ts @@ -0,0 +1,46 @@ +import { error } from '@sveltejs/kit'; +import { getModel } from '#lib/server/cars.js'; +import type { carModels, carVariants } from '#lib/server/db/schema/index.js'; +import type { PageServerLoad } from './$types'; + +type Model = typeof carModels.$inferSelect; +type Variant = typeof carVariants.$inferSelect; + +// Drop internal ids and the search blob before the row goes to the browser. +function publicCar(m: Model) { + const out: Partial = { ...m }; + delete out.id; + delete out.brandId; + delete out.search; + delete out.createdAt; + delete out.updatedAt; + return { + ...(out as Omit), + updatedAt: m.updatedAt?.toISOString() ?? null + }; +} +function publicVariant(v: Variant) { + const out: Partial = { ...v }; + delete out.id; + delete out.modelId; + delete out.source; + return out as Omit; +} + +export const load: PageServerLoad = async ({ params }) => { + const found = await getModel(params.brand, params.model); + if (!found) error(404, 'No such car in the pokedex'); + const { model, brand, variants, prev, next } = found; + return { + car: publicCar(model), + brand: { slug: brand.slug, name: brand.name, country: brand.country }, + variants: variants.map(publicVariant), + prev, + next, + currentYear: new Date().getFullYear(), + seo: { + title: `${brand.name} ${model.name}`, + description: `${brand.name} ${model.name}${model.firstYear ? ` (${model.firstYear}${model.lastYear && model.lastYear !== model.firstYear ? `โ€“${model.lastYear}` : ''})` : ''}: specs, fuel types, Dutch registrations and US fuel economy.` + } + }; +}; diff --git a/src/routes/trackers/cars/[brand]/[model]/+page.svelte b/src/routes/trackers/cars/[brand]/[model]/+page.svelte new file mode 100644 index 0000000..29bf072 --- /dev/null +++ b/src/routes/trackers/cars/[brand]/[model]/+page.svelte @@ -0,0 +1,576 @@ + + +
+ + +
+
+ +
+

{dexLabel(car.dex)}

+

+ {data.brand.name} + {car.name} +

+

+ {#if data.brand.country}{flag(data.brand.country)} {data.brand.country} ยท + {/if}{years(car.firstYear, car.lastYear, data.currentYear) ?? + 'years unknown'}{#if car.bodies.length} + ยท {car.bodies.map((b) => bodyLabel[b] ?? b).join(' / ')}{/if} +

+
+
+ {#if car.fuels.length} +
+ {#each car.fuels as fuel (fuel)}{/each} +
+ {/if} +
+ + {#if baseStats.length} +
+

base stats

+
    + {#each baseStats as s (s.label)} +
  • + {s.label} + + {s.value}{s.hint} +
  • + {/each} +
+

Bars compare against all cars: 600 hp, 0 g COโ‚‚, 400k registrations, โ‚ฌ150k.

+
+ {/if} + + {#if car.fuels.length} +
+

what the fuel types mean

+
    + {#each car.fuels as fuel (fuel)} +
  • {fuelHint[fuel]}
  • + {/each} +
+
+ {/if} + +
+

spec sheet

+
+ {#each facts as [label, value] (label)} +
+
{label}
+
{value || 'โ€”'}
+
+ {/each} +
+

Ranges cover every version ever sold. Blank means the sources don't say.

+
+ + {#if nlYears.length} +
+

๐Ÿ‡ณ๐Ÿ‡ฑ on Dutch roads

+

+ {fmtNumber(car.nlCount)} are registered in the Netherlands today{#if car.nlRank}, + #{car.nlRank} of all models{/if}. Most common build year: {peak.y} + ({fmtNumber(peak.n)} cars). +

+ +
{nlYears[0].y}{nlYears.at(-1)?.y}
+

Cars still registered, by year of first registration (RDW).

+ + {#if used.length} +

secondhand shopping hint

+

+ Cars 8โ€“20 years old are where budget buys usually live. The register has + {fmtNumber(used.reduce((a, y) => a + y.n, 0))} + {car.name}s from {used[0].y}โ€“{used.at(-1)?.y}, so there should be plenty to choose from on + Marktplaats or AutoScout24. Their price when new: +

+
    + {#each used.filter((y) => y.price).slice(-6) as y (y.y)} +
  • {y.y}{fmtEuro(y.price!)}
  • + {/each} +
+ {/if} + + {#if car.nlNames.length > 1} +
+ names it's registered under ({car.nlNames.length}) +
    + {#each car.nlNames as n (n.name)}
  • {n.name} {fmtNumber(n.n)}
  • {/each} +
+
+ {/if} +
+ {/if} + + {#if variants.length} +
+

๐Ÿ‡บ๐Ÿ‡ธ US versions ({fmtNumber(variants.length)})

+

+ Every version the EPA tested{#if car.usYears.length}, model years {car + .usYears[0]}โ€“{car.usYears.at(-1)}{/if}. mpg is combined; L/100 km converted. +

+
+ + + + + + {#each shownVariants as v, i (i)} + + + + + + + + + + + {/each} + +
yearversionenginegearboxdrivefuelmpgL/100
{v.year}{v.name}{#if v.evMotor && !v.engineL}{v.evMotor}{:else}{v.engineL + ? `${v.engineL.toFixed(1)} L` + : ''}{v.cylinders ? ` ${v.cylinders} cyl` : ''}{v.turbo + ? ' turbo' + : ''}{v.supercharged ? ' SC' : ''}{/if}{#if v.rangeMi} + ยท {Math.round(v.rangeMi * 1.609)} km range{/if}{v.transmission ?? 'โ€”'}{shortDrive(v.drive)}{v.fuel ?? 'โ€”'}{v.mpgComb ?? 'โ€”'}{v.mpgComb && v.fuel !== 'Electricity' + ? mpgToL100(v.mpgComb).toFixed(1) + : 'โ€”'}
+
+ {#if variants.length > 25} + + {/if} +
+ {/if} + +

+ Sources: {#each car.sources as s, i (s)}{i ? ', ' : ''}{#if s === 'RDW open data'}RDW open data{:else if s === 'fueleconomy.gov'}fueleconomy.gov{:else}{s}{/if}{/each}.{#if car.updatedAt} + Updated {car.updatedAt.slice(0, 10)}.{/if} +

+
+ + diff --git a/src/routes/trackers/cars/random/+server.ts b/src/routes/trackers/cars/random/+server.ts new file mode 100644 index 0000000..57f8c19 --- /dev/null +++ b/src/routes/trackers/cars/random/+server.ts @@ -0,0 +1,9 @@ +import { redirect } from '@sveltejs/kit'; +import { randomCar } from '#lib/server/cars.js'; +import type { RequestHandler } from './$types'; + +export const GET: RequestHandler = async ({ setHeaders }) => { + const car = await randomCar(); + setHeaders({ 'cache-control': 'no-store' }); + redirect(303, car ? `/trackers/cars/${car.brandSlug}/${car.slug}` : '/trackers/cars'); +};