From d98ce7f2bd13190fb840bcdceebd2d8414cd09d9 Mon Sep 17 00:00:00 2001 From: tangoyankee Date: Fri, 5 Jul 2024 17:13:05 -0400 Subject: [PATCH] try introspection with drizzle --- .nvmrc | 1 + drizzle.config.ts | 18 + .../migration/0000_wooden_clint_barton.sql | 290 ++++ drizzle/migration/meta/0000_snapshot.json | 1268 ++++++++++++++++ drizzle/migration/meta/_journal.json | 13 + drizzle/migration/relations.ts | 128 ++ drizzle/migration/schema.ts | 237 +++ package-lock.json | 1279 +++++++++++++++++ package.json | 20 + sample.env | 7 + 10 files changed, 3261 insertions(+) create mode 100644 .nvmrc create mode 100644 drizzle.config.ts create mode 100644 drizzle/migration/0000_wooden_clint_barton.sql create mode 100644 drizzle/migration/meta/0000_snapshot.json create mode 100644 drizzle/migration/meta/_journal.json create mode 100644 drizzle/migration/relations.ts create mode 100644 drizzle/migration/schema.ts create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..a81deba --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.12.2 diff --git a/drizzle.config.ts b/drizzle.config.ts new file mode 100644 index 0000000..e4ba57c --- /dev/null +++ b/drizzle.config.ts @@ -0,0 +1,18 @@ +// Drizzle kit configuration +import type { Config } from "drizzle-kit"; + +export default { + schema: "./drizzle/schema/*", + dialect: "postgresql", + out: "./drizzle/migration", + dbCredentials: { + host: process.env.DRIZZLE_DATABASE_HOST!, + port: parseInt(process.env.DRIZZLE_DATABASE_PORT!), + user: process.env.DRIZZLE_DATABASE_USER, + password: process.env.DRIZZLE_DATABASE_PASSWORD, + database: process.env.DRIZZLE_DATABASE_NAME!, + ssl: process.env.DRIZZLE_DATABASE_ENV !== "development" && { + rejectUnauthorized: false, + }, + }, +} satisfies Config; diff --git a/drizzle/migration/0000_wooden_clint_barton.sql b/drizzle/migration/0000_wooden_clint_barton.sql new file mode 100644 index 0000000..ba65f23 --- /dev/null +++ b/drizzle/migration/0000_wooden_clint_barton.sql @@ -0,0 +1,290 @@ +-- Current sql file was generated after introspecting the database +-- If you want to run this migration please uncomment this code before executing migrations +/* +DO $$ BEGIN + CREATE TYPE "public"."capital_fund_category" AS ENUM('city-non-exempt', 'city-exempt', 'city-cost', 'non-city-state', 'non-city-federal', 'non-city-other', 'non-city-cost', 'total'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + CREATE TYPE "public"."capital_project_category" AS ENUM('Fixed Asset', 'Lump Sum', 'ITT, Vehicles and Equipment'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + CREATE TYPE "public"."capital_project_fund_stage" AS ENUM('adopt', 'allocate', 'commit', 'spent'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + CREATE TYPE "public"."category" AS ENUM('Residential', 'Commercial', 'Manufacturing'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "geography_columns" ( + "f_table_catalog" "name", + "f_table_schema" "name", + "f_table_name" "name", + "f_geography_column" "name", + "coord_dimension" integer, + "srid" integer, + "type" text +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "geometry_columns" ( + "f_table_catalog" varchar(256), + "f_table_schema" "name", + "f_table_name" "name", + "f_geometry_column" "name", + "coord_dimension" integer, + "srid" integer, + "type" varchar(30) +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "spatial_ref_sys" ( + "srid" integer PRIMARY KEY NOT NULL, + "auth_name" varchar(256), + "auth_srid" integer, + "srtext" varchar(2048), + "proj4text" varchar(2048) +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "borough" ( + "id" char(1) PRIMARY KEY NOT NULL, + "title" text NOT NULL, + "abbr" text NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "tax_lot" ( + "bbl" char(10) PRIMARY KEY NOT NULL, + "borough_id" char(1) NOT NULL, + "block" text NOT NULL, + "lot" text NOT NULL, + "address" text, + "land_use_id" char(2), + "wgs84" "geography" NOT NULL, + "li_ft" geometry(MultiPolygon,2263) NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "land_use" ( + "id" char(2) PRIMARY KEY NOT NULL, + "description" text NOT NULL, + "color" char(9) NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "zoning_district" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "label" text NOT NULL, + "wgs84" "geography" NOT NULL, + "li_ft" geometry(MultiPolygon,2263) NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "zoning_district_zoning_district_class" ( + "zoning_district_id" uuid NOT NULL, + "zoning_district_class_id" text NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "zoning_district_class" ( + "id" text PRIMARY KEY NOT NULL, + "category" "category", + "description" text NOT NULL, + "url" text, + "color" char(9) NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "city_council_district" ( + "id" text PRIMARY KEY NOT NULL, + "li_ft" geometry(MultiPolygon,2263), + "mercator_fill" geometry(MultiPolygon,3857), + "mercator_label" geometry(Point,3857) +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "agency" ( + "initials" text PRIMARY KEY NOT NULL, + "name" text NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "agency_budget" ( + "code" text PRIMARY KEY NOT NULL, + "type" text, + "sponsor" text +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "capital_commitment_fund" ( + "id" uuid PRIMARY KEY NOT NULL, + "capital_commitment_id" uuid, + "capital_fund_category" "capital_fund_category", + "value" numeric +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "capital_commitment_type" ( + "code" char(4) PRIMARY KEY NOT NULL, + "description" text +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "capital_project_checkbook" ( + "id" uuid PRIMARY KEY NOT NULL, + "managing_code" char(3), + "capital_project_id" text, + "value" numeric +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "capital_project_fund" ( + "id" uuid PRIMARY KEY NOT NULL, + "managing_code" char(3), + "capital_project_id" text, + "capital_fund_category" "capital_fund_category", + "stage" "capital_project_fund_stage", + "value" numeric +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "managing_code" ( + "id" char(3) PRIMARY KEY NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "capital_commitment" ( + "id" uuid PRIMARY KEY NOT NULL, + "type" char(4), + "planned_date" date, + "managing_code" char(3), + "capital_project_id" text, + "budget_line_code" text, + "budget_line_id" text +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "budget_line" ( + "code" text NOT NULL, + "id" text NOT NULL, + CONSTRAINT "budget_line_code_id_pk" PRIMARY KEY("code","id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "community_district" ( + "borough_id" char(1) NOT NULL, + "id" char(2) NOT NULL, + "mercator_fill" geometry(MultiPolygon,3857), + "mercator_label" geometry(Point,3857), + "li_ft" geometry(MultiPolygon,2263), + CONSTRAINT "community_district_borough_id_id_pk" PRIMARY KEY("borough_id","id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "capital_project" ( + "managing_code" char(3) NOT NULL, + "id" text NOT NULL, + "managing_agency" text NOT NULL, + "description" text NOT NULL, + "min_date" date NOT NULL, + "max_date" date NOT NULL, + "category" "capital_project_category", + "li_ft_m_pnt" geometry(MultiPoint,2263), + "li_ft_m_poly" geometry(MultiPolygon,2263), + "mercator_label" geometry(Point,3857), + "mercator_fill_m_pnt" geometry(MultiPoint,3857), + "mercator_fill_m_poly" geometry(MultiPolygon,3857), + CONSTRAINT "capital_project_managing_code_id_pk" PRIMARY KEY("managing_code","id") +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "tax_lot" ADD CONSTRAINT "tax_lot_borough_id_borough_id_fk" FOREIGN KEY ("borough_id") REFERENCES "public"."borough"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "tax_lot" ADD CONSTRAINT "tax_lot_land_use_id_land_use_id_fk" FOREIGN KEY ("land_use_id") REFERENCES "public"."land_use"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "zoning_district_zoning_district_class" ADD CONSTRAINT "zoning_district_zoning_district_class_zoning_district_id_zoning" FOREIGN KEY ("zoning_district_id") REFERENCES "public"."zoning_district"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "zoning_district_zoning_district_class" ADD CONSTRAINT "zoning_district_zoning_district_class_zoning_district_class_id_" FOREIGN KEY ("zoning_district_class_id") REFERENCES "public"."zoning_district_class"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "agency_budget" ADD CONSTRAINT "agency_budget_sponsor_agency_initials_fk" FOREIGN KEY ("sponsor") REFERENCES "public"."agency"("initials") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "capital_commitment_fund" ADD CONSTRAINT "capital_commitment_fund_capital_commitment_id_capital_commitmen" FOREIGN KEY ("capital_commitment_id") REFERENCES "public"."capital_commitment"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "capital_project_checkbook" ADD CONSTRAINT "custom_fk" FOREIGN KEY ("managing_code","capital_project_id") REFERENCES "public"."capital_project"("managing_code","id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "capital_project_fund" ADD CONSTRAINT "custom_fk" FOREIGN KEY ("managing_code","capital_project_id") REFERENCES "public"."capital_project"("managing_code","id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "capital_commitment" ADD CONSTRAINT "capital_commitment_type_capital_commitment_type_code_fk" FOREIGN KEY ("type") REFERENCES "public"."capital_commitment_type"("code") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "capital_commitment" ADD CONSTRAINT "capital_commitment_managing_code_capital_project_id_capital_pro" FOREIGN KEY ("managing_code","capital_project_id") REFERENCES "public"."capital_project"("managing_code","id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "capital_commitment" ADD CONSTRAINT "capital_commitment_budget_line_code_budget_line_id_budget_line_" FOREIGN KEY ("budget_line_code","budget_line_id") REFERENCES "public"."budget_line"("code","id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "budget_line" ADD CONSTRAINT "budget_line_code_agency_budget_code_fk" FOREIGN KEY ("code") REFERENCES "public"."agency_budget"("code") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "community_district" ADD CONSTRAINT "community_district_borough_id_borough_id_fk" FOREIGN KEY ("borough_id") REFERENCES "public"."borough"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "capital_project" ADD CONSTRAINT "capital_project_managing_code_managing_code_id_fk" FOREIGN KEY ("managing_code") REFERENCES "public"."managing_code"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "capital_project" ADD CONSTRAINT "capital_project_managing_agency_agency_initials_fk" FOREIGN KEY ("managing_agency") REFERENCES "public"."agency"("initials") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "city_council_district_li_ft_index" ON "city_council_district" USING gist ("li_ft" gist_geometry_ops_2d);--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "city_council_district_mercator_fill_index" ON "city_council_district" USING gist ("mercator_fill" gist_geometry_ops_2d);--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "city_council_district_mercator_label_index" ON "city_council_district" USING gist ("mercator_label" gist_geometry_ops_2d);--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "community_district_li_ft_index" ON "community_district" USING gist ("li_ft" gist_geometry_ops_2d);--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "community_district_mercator_fill_index" ON "community_district" USING gist ("mercator_fill" gist_geometry_ops_2d);--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "community_district_mercator_label_index" ON "community_district" USING gist ("mercator_label" gist_geometry_ops_2d);--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "capital_project_li_ft_m_pnt_index" ON "capital_project" USING gist ("li_ft_m_pnt" gist_geometry_ops_2d);--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "capital_project_li_ft_m_poly_index" ON "capital_project" USING gist ("li_ft_m_poly" gist_geometry_ops_2d);--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "capital_project_mercator_fill_m_pnt_index" ON "capital_project" USING gist ("mercator_fill_m_pnt" gist_geometry_ops_2d);--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "capital_project_mercator_fill_m_poly_index" ON "capital_project" USING gist ("mercator_fill_m_poly" gist_geometry_ops_2d); +*/ \ No newline at end of file diff --git a/drizzle/migration/meta/0000_snapshot.json b/drizzle/migration/meta/0000_snapshot.json new file mode 100644 index 0000000..5f389d4 --- /dev/null +++ b/drizzle/migration/meta/0000_snapshot.json @@ -0,0 +1,1268 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "prevId": "", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.geography_columns": { + "name": "geography_columns", + "schema": "", + "columns": { + "f_table_catalog": { + "name": "f_table_catalog", + "type": "name", + "primaryKey": false, + "notNull": false + }, + "f_table_schema": { + "name": "f_table_schema", + "type": "name", + "primaryKey": false, + "notNull": false + }, + "f_table_name": { + "name": "f_table_name", + "type": "name", + "primaryKey": false, + "notNull": false + }, + "f_geography_column": { + "name": "f_geography_column", + "type": "name", + "primaryKey": false, + "notNull": false + }, + "coord_dimension": { + "name": "coord_dimension", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "srid": { + "name": "srid", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.geometry_columns": { + "name": "geometry_columns", + "schema": "", + "columns": { + "f_table_catalog": { + "name": "f_table_catalog", + "type": "varchar(256)", + "primaryKey": false, + "notNull": false + }, + "f_table_schema": { + "name": "f_table_schema", + "type": "name", + "primaryKey": false, + "notNull": false + }, + "f_table_name": { + "name": "f_table_name", + "type": "name", + "primaryKey": false, + "notNull": false + }, + "f_geometry_column": { + "name": "f_geometry_column", + "type": "name", + "primaryKey": false, + "notNull": false + }, + "coord_dimension": { + "name": "coord_dimension", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "srid": { + "name": "srid", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.spatial_ref_sys": { + "name": "spatial_ref_sys", + "schema": "", + "columns": { + "srid": { + "name": "srid", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "auth_name": { + "name": "auth_name", + "type": "varchar(256)", + "primaryKey": false, + "notNull": false + }, + "auth_srid": { + "name": "auth_srid", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "srtext": { + "name": "srtext", + "type": "varchar(2048)", + "primaryKey": false, + "notNull": false + }, + "proj4text": { + "name": "proj4text", + "type": "varchar(2048)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.borough": { + "name": "borough", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "char(1)", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "abbr": { + "name": "abbr", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.tax_lot": { + "name": "tax_lot", + "schema": "", + "columns": { + "bbl": { + "name": "bbl", + "type": "char(10)", + "primaryKey": true, + "notNull": true + }, + "borough_id": { + "name": "borough_id", + "type": "char(1)", + "primaryKey": false, + "notNull": true + }, + "block": { + "name": "block", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lot": { + "name": "lot", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "land_use_id": { + "name": "land_use_id", + "type": "char(2)", + "primaryKey": false, + "notNull": false + }, + "wgs84": { + "name": "wgs84", + "type": "geography", + "primaryKey": false, + "notNull": true + }, + "li_ft": { + "name": "li_ft", + "type": "geometry(MultiPolygon,2263)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "tax_lot_borough_id_borough_id_fk": { + "name": "tax_lot_borough_id_borough_id_fk", + "tableFrom": "tax_lot", + "tableTo": "borough", + "schemaTo": "public", + "columnsFrom": [ + "borough_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "tax_lot_land_use_id_land_use_id_fk": { + "name": "tax_lot_land_use_id_land_use_id_fk", + "tableFrom": "tax_lot", + "tableTo": "land_use", + "schemaTo": "public", + "columnsFrom": [ + "land_use_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.land_use": { + "name": "land_use", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "char(2)", + "primaryKey": true, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "color": { + "name": "color", + "type": "char(9)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.zoning_district": { + "name": "zoning_district", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "wgs84": { + "name": "wgs84", + "type": "geography", + "primaryKey": false, + "notNull": true + }, + "li_ft": { + "name": "li_ft", + "type": "geometry(MultiPolygon,2263)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.zoning_district_zoning_district_class": { + "name": "zoning_district_zoning_district_class", + "schema": "", + "columns": { + "zoning_district_id": { + "name": "zoning_district_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "zoning_district_class_id": { + "name": "zoning_district_class_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "zoning_district_zoning_district_class_zoning_district_id_zoning": { + "name": "zoning_district_zoning_district_class_zoning_district_id_zoning", + "tableFrom": "zoning_district_zoning_district_class", + "tableTo": "zoning_district", + "schemaTo": "public", + "columnsFrom": [ + "zoning_district_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "zoning_district_zoning_district_class_zoning_district_class_id_": { + "name": "zoning_district_zoning_district_class_zoning_district_class_id_", + "tableFrom": "zoning_district_zoning_district_class", + "tableTo": "zoning_district_class", + "schemaTo": "public", + "columnsFrom": [ + "zoning_district_class_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.zoning_district_class": { + "name": "zoning_district_class", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "category": { + "name": "category", + "type": "category", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "color": { + "name": "color", + "type": "char(9)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.city_council_district": { + "name": "city_council_district", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "li_ft": { + "name": "li_ft", + "type": "geometry(MultiPolygon,2263)", + "primaryKey": false, + "notNull": false + }, + "mercator_fill": { + "name": "mercator_fill", + "type": "geometry(MultiPolygon,3857)", + "primaryKey": false, + "notNull": false + }, + "mercator_label": { + "name": "mercator_label", + "type": "geometry(Point,3857)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "city_council_district_li_ft_index": { + "name": "city_council_district_li_ft_index", + "columns": [ + { + "expression": "li_ft", + "asc": true, + "nulls": "last", + "opclass": "gist_geometry_ops_2d", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "city_council_district_mercator_fill_index": { + "name": "city_council_district_mercator_fill_index", + "columns": [ + { + "expression": "mercator_fill", + "asc": true, + "nulls": "last", + "opclass": "gist_geometry_ops_2d", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "city_council_district_mercator_label_index": { + "name": "city_council_district_mercator_label_index", + "columns": [ + { + "expression": "mercator_label", + "asc": true, + "nulls": "last", + "opclass": "gist_geometry_ops_2d", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.agency": { + "name": "agency", + "schema": "", + "columns": { + "initials": { + "name": "initials", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.agency_budget": { + "name": "agency_budget", + "schema": "", + "columns": { + "code": { + "name": "code", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sponsor": { + "name": "sponsor", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "agency_budget_sponsor_agency_initials_fk": { + "name": "agency_budget_sponsor_agency_initials_fk", + "tableFrom": "agency_budget", + "tableTo": "agency", + "schemaTo": "public", + "columnsFrom": [ + "sponsor" + ], + "columnsTo": [ + "initials" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.capital_commitment_fund": { + "name": "capital_commitment_fund", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "capital_commitment_id": { + "name": "capital_commitment_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "capital_fund_category": { + "name": "capital_fund_category", + "type": "capital_fund_category", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "value": { + "name": "value", + "type": "numeric", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "capital_commitment_fund_capital_commitment_id_capital_commitmen": { + "name": "capital_commitment_fund_capital_commitment_id_capital_commitmen", + "tableFrom": "capital_commitment_fund", + "tableTo": "capital_commitment", + "schemaTo": "public", + "columnsFrom": [ + "capital_commitment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.capital_commitment_type": { + "name": "capital_commitment_type", + "schema": "", + "columns": { + "code": { + "name": "code", + "type": "char(4)", + "primaryKey": true, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.capital_project_checkbook": { + "name": "capital_project_checkbook", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "managing_code": { + "name": "managing_code", + "type": "char(3)", + "primaryKey": false, + "notNull": false + }, + "capital_project_id": { + "name": "capital_project_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "value": { + "name": "value", + "type": "numeric", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "custom_fk": { + "name": "custom_fk", + "tableFrom": "capital_project_checkbook", + "tableTo": "capital_project", + "schemaTo": "public", + "columnsFrom": [ + "managing_code", + "capital_project_id" + ], + "columnsTo": [ + "managing_code", + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.capital_project_fund": { + "name": "capital_project_fund", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "managing_code": { + "name": "managing_code", + "type": "char(3)", + "primaryKey": false, + "notNull": false + }, + "capital_project_id": { + "name": "capital_project_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "capital_fund_category": { + "name": "capital_fund_category", + "type": "capital_fund_category", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "stage": { + "name": "stage", + "type": "capital_project_fund_stage", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "value": { + "name": "value", + "type": "numeric", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "custom_fk": { + "name": "custom_fk", + "tableFrom": "capital_project_fund", + "tableTo": "capital_project", + "schemaTo": "public", + "columnsFrom": [ + "managing_code", + "capital_project_id" + ], + "columnsTo": [ + "managing_code", + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.managing_code": { + "name": "managing_code", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "char(3)", + "primaryKey": true, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.capital_commitment": { + "name": "capital_commitment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "char(4)", + "primaryKey": false, + "notNull": false + }, + "planned_date": { + "name": "planned_date", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "managing_code": { + "name": "managing_code", + "type": "char(3)", + "primaryKey": false, + "notNull": false + }, + "capital_project_id": { + "name": "capital_project_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget_line_code": { + "name": "budget_line_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget_line_id": { + "name": "budget_line_id", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "capital_commitment_type_capital_commitment_type_code_fk": { + "name": "capital_commitment_type_capital_commitment_type_code_fk", + "tableFrom": "capital_commitment", + "tableTo": "capital_commitment_type", + "schemaTo": "public", + "columnsFrom": [ + "type" + ], + "columnsTo": [ + "code" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "capital_commitment_managing_code_capital_project_id_capital_pro": { + "name": "capital_commitment_managing_code_capital_project_id_capital_pro", + "tableFrom": "capital_commitment", + "tableTo": "capital_project", + "schemaTo": "public", + "columnsFrom": [ + "managing_code", + "capital_project_id" + ], + "columnsTo": [ + "managing_code", + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "capital_commitment_budget_line_code_budget_line_id_budget_line_": { + "name": "capital_commitment_budget_line_code_budget_line_id_budget_line_", + "tableFrom": "capital_commitment", + "tableTo": "budget_line", + "schemaTo": "public", + "columnsFrom": [ + "budget_line_code", + "budget_line_id" + ], + "columnsTo": [ + "code", + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.budget_line": { + "name": "budget_line", + "schema": "", + "columns": { + "code": { + "name": "code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "budget_line_code_agency_budget_code_fk": { + "name": "budget_line_code_agency_budget_code_fk", + "tableFrom": "budget_line", + "tableTo": "agency_budget", + "schemaTo": "public", + "columnsFrom": [ + "code" + ], + "columnsTo": [ + "code" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "budget_line_code_id_pk": { + "name": "budget_line_code_id_pk", + "columns": [ + "code", + "id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.community_district": { + "name": "community_district", + "schema": "", + "columns": { + "borough_id": { + "name": "borough_id", + "type": "char(1)", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "char(2)", + "primaryKey": false, + "notNull": true + }, + "mercator_fill": { + "name": "mercator_fill", + "type": "geometry(MultiPolygon,3857)", + "primaryKey": false, + "notNull": false + }, + "mercator_label": { + "name": "mercator_label", + "type": "geometry(Point,3857)", + "primaryKey": false, + "notNull": false + }, + "li_ft": { + "name": "li_ft", + "type": "geometry(MultiPolygon,2263)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "community_district_li_ft_index": { + "name": "community_district_li_ft_index", + "columns": [ + { + "expression": "li_ft", + "asc": true, + "nulls": "last", + "opclass": "gist_geometry_ops_2d", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "community_district_mercator_fill_index": { + "name": "community_district_mercator_fill_index", + "columns": [ + { + "expression": "mercator_fill", + "asc": true, + "nulls": "last", + "opclass": "gist_geometry_ops_2d", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "community_district_mercator_label_index": { + "name": "community_district_mercator_label_index", + "columns": [ + { + "expression": "mercator_label", + "asc": true, + "nulls": "last", + "opclass": "gist_geometry_ops_2d", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + } + }, + "foreignKeys": { + "community_district_borough_id_borough_id_fk": { + "name": "community_district_borough_id_borough_id_fk", + "tableFrom": "community_district", + "tableTo": "borough", + "schemaTo": "public", + "columnsFrom": [ + "borough_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "community_district_borough_id_id_pk": { + "name": "community_district_borough_id_id_pk", + "columns": [ + "borough_id", + "id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.capital_project": { + "name": "capital_project", + "schema": "", + "columns": { + "managing_code": { + "name": "managing_code", + "type": "char(3)", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "managing_agency": { + "name": "managing_agency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "min_date": { + "name": "min_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "max_date": { + "name": "max_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "category": { + "name": "category", + "type": "capital_project_category", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "li_ft_m_pnt": { + "name": "li_ft_m_pnt", + "type": "geometry(MultiPoint,2263)", + "primaryKey": false, + "notNull": false + }, + "li_ft_m_poly": { + "name": "li_ft_m_poly", + "type": "geometry(MultiPolygon,2263)", + "primaryKey": false, + "notNull": false + }, + "mercator_label": { + "name": "mercator_label", + "type": "geometry(Point,3857)", + "primaryKey": false, + "notNull": false + }, + "mercator_fill_m_pnt": { + "name": "mercator_fill_m_pnt", + "type": "geometry(MultiPoint,3857)", + "primaryKey": false, + "notNull": false + }, + "mercator_fill_m_poly": { + "name": "mercator_fill_m_poly", + "type": "geometry(MultiPolygon,3857)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "capital_project_li_ft_m_pnt_index": { + "name": "capital_project_li_ft_m_pnt_index", + "columns": [ + { + "expression": "li_ft_m_pnt", + "asc": true, + "nulls": "last", + "opclass": "gist_geometry_ops_2d", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "capital_project_li_ft_m_poly_index": { + "name": "capital_project_li_ft_m_poly_index", + "columns": [ + { + "expression": "li_ft_m_poly", + "asc": true, + "nulls": "last", + "opclass": "gist_geometry_ops_2d", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "capital_project_mercator_fill_m_pnt_index": { + "name": "capital_project_mercator_fill_m_pnt_index", + "columns": [ + { + "expression": "mercator_fill_m_pnt", + "asc": true, + "nulls": "last", + "opclass": "gist_geometry_ops_2d", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "capital_project_mercator_fill_m_poly_index": { + "name": "capital_project_mercator_fill_m_poly_index", + "columns": [ + { + "expression": "mercator_fill_m_poly", + "asc": true, + "nulls": "last", + "opclass": "gist_geometry_ops_2d", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + } + }, + "foreignKeys": { + "capital_project_managing_code_managing_code_id_fk": { + "name": "capital_project_managing_code_managing_code_id_fk", + "tableFrom": "capital_project", + "tableTo": "managing_code", + "schemaTo": "public", + "columnsFrom": [ + "managing_code" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "capital_project_managing_agency_agency_initials_fk": { + "name": "capital_project_managing_agency_agency_initials_fk", + "tableFrom": "capital_project", + "tableTo": "agency", + "schemaTo": "public", + "columnsFrom": [ + "managing_agency" + ], + "columnsTo": [ + "initials" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "capital_project_managing_code_id_pk": { + "name": "capital_project_managing_code_id_pk", + "columns": [ + "managing_code", + "id" + ] + } + }, + "uniqueConstraints": {} + } + }, + "enums": { + "public.capital_fund_category": { + "name": "capital_fund_category", + "values": [ + "city-non-exempt", + "city-exempt", + "city-cost", + "non-city-state", + "non-city-federal", + "non-city-other", + "non-city-cost", + "total" + ], + "schema": "public" + }, + "public.capital_project_category": { + "name": "capital_project_category", + "values": [ + "Fixed Asset", + "Lump Sum", + "ITT, Vehicles and Equipment" + ], + "schema": "public" + }, + "public.capital_project_fund_stage": { + "name": "capital_project_fund_stage", + "values": [ + "adopt", + "allocate", + "commit", + "spent" + ], + "schema": "public" + }, + "public.category": { + "name": "category", + "values": [ + "Residential", + "Commercial", + "Manufacturing" + ], + "schema": "public" + } + }, + "schemas": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/migration/meta/_journal.json b/drizzle/migration/meta/_journal.json new file mode 100644 index 0000000..7849450 --- /dev/null +++ b/drizzle/migration/meta/_journal.json @@ -0,0 +1,13 @@ +{ + "version": "7", + "dialect": "postgresql", + "entries": [ + { + "idx": 0, + "version": "7", + "when": 1720213837149, + "tag": "0000_wooden_clint_barton", + "breakpoints": true + } + ] +} \ No newline at end of file diff --git a/drizzle/migration/relations.ts b/drizzle/migration/relations.ts new file mode 100644 index 0000000..e82ebc3 --- /dev/null +++ b/drizzle/migration/relations.ts @@ -0,0 +1,128 @@ +import { relations } from "drizzle-orm/relations"; +import { borough, tax_lot, land_use, zoning_district, zoning_district_zoning_district_class, zoning_district_class, agency, agency_budget, capital_commitment, capital_commitment_fund, capital_project, capital_project_checkbook, capital_project_fund, capital_commitment_type, budget_line, community_district, managing_code } from "./schema"; + +export const tax_lotRelations = relations(tax_lot, ({one}) => ({ + borough: one(borough, { + fields: [tax_lot.borough_id], + references: [borough.id] + }), + land_use: one(land_use, { + fields: [tax_lot.land_use_id], + references: [land_use.id] + }), +})); + +export const boroughRelations = relations(borough, ({many}) => ({ + tax_lots: many(tax_lot), + community_districts: many(community_district), +})); + +export const land_useRelations = relations(land_use, ({many}) => ({ + tax_lots: many(tax_lot), +})); + +export const zoning_district_zoning_district_classRelations = relations(zoning_district_zoning_district_class, ({one}) => ({ + zoning_district: one(zoning_district, { + fields: [zoning_district_zoning_district_class.zoning_district_id], + references: [zoning_district.id] + }), + zoning_district_class: one(zoning_district_class, { + fields: [zoning_district_zoning_district_class.zoning_district_class_id], + references: [zoning_district_class.id] + }), +})); + +export const zoning_districtRelations = relations(zoning_district, ({many}) => ({ + zoning_district_zoning_district_classes: many(zoning_district_zoning_district_class), +})); + +export const zoning_district_classRelations = relations(zoning_district_class, ({many}) => ({ + zoning_district_zoning_district_classes: many(zoning_district_zoning_district_class), +})); + +export const agency_budgetRelations = relations(agency_budget, ({one, many}) => ({ + agency: one(agency, { + fields: [agency_budget.sponsor], + references: [agency.initials] + }), + budget_lines: many(budget_line), +})); + +export const agencyRelations = relations(agency, ({many}) => ({ + agency_budgets: many(agency_budget), + capital_projects: many(capital_project), +})); + +export const capital_commitment_fundRelations = relations(capital_commitment_fund, ({one}) => ({ + capital_commitment: one(capital_commitment, { + fields: [capital_commitment_fund.capital_commitment_id], + references: [capital_commitment.id] + }), +})); + +export const capital_commitmentRelations = relations(capital_commitment, ({one, many}) => ({ + capital_commitment_funds: many(capital_commitment_fund), + capital_commitment_type: one(capital_commitment_type, { + fields: [capital_commitment.type], + references: [capital_commitment_type.code] + }), + capital_project: one(capital_project, { + fields: [capital_commitment.managing_code], + references: [capital_project.managing_code] + }), + budget_line: one(budget_line, { + fields: [capital_commitment.budget_line_code], + references: [budget_line.code] + }), +})); + +export const capital_project_checkbookRelations = relations(capital_project_checkbook, ({one}) => ({ + capital_project: one(capital_project, { + fields: [capital_project_checkbook.managing_code], + references: [capital_project.managing_code] + }), +})); + +export const capital_projectRelations = relations(capital_project, ({one, many}) => ({ + capital_project_checkbooks: many(capital_project_checkbook), + capital_project_funds: many(capital_project_fund), + capital_commitments: many(capital_commitment), + managing_code: one(managing_code, { + fields: [capital_project.managing_code], + references: [managing_code.id] + }), + agency: one(agency, { + fields: [capital_project.managing_agency], + references: [agency.initials] + }), +})); + +export const capital_project_fundRelations = relations(capital_project_fund, ({one}) => ({ + capital_project: one(capital_project, { + fields: [capital_project_fund.managing_code], + references: [capital_project.managing_code] + }), +})); + +export const capital_commitment_typeRelations = relations(capital_commitment_type, ({many}) => ({ + capital_commitments: many(capital_commitment), +})); + +export const budget_lineRelations = relations(budget_line, ({one, many}) => ({ + capital_commitments: many(capital_commitment), + agency_budget: one(agency_budget, { + fields: [budget_line.code], + references: [agency_budget.code] + }), +})); + +export const community_districtRelations = relations(community_district, ({one}) => ({ + borough: one(borough, { + fields: [community_district.borough_id], + references: [borough.id] + }), +})); + +export const managing_codeRelations = relations(managing_code, ({many}) => ({ + capital_projects: many(capital_project), +})); \ No newline at end of file diff --git a/drizzle/migration/schema.ts b/drizzle/migration/schema.ts new file mode 100644 index 0000000..c531bce --- /dev/null +++ b/drizzle/migration/schema.ts @@ -0,0 +1,237 @@ +import { pgTable, pgEnum, integer, text, varchar, char, foreignKey, geometry, uuid, index, numeric, date, primaryKey } from "drizzle-orm/pg-core" + import { sql } from "drizzle-orm" + +export const capital_fund_category = pgEnum("capital_fund_category", ['city-non-exempt', 'city-exempt', 'city-cost', 'non-city-state', 'non-city-federal', 'non-city-other', 'non-city-cost', 'total']) +export const capital_project_category = pgEnum("capital_project_category", ['Fixed Asset', 'Lump Sum', 'ITT, Vehicles and Equipment']) +export const capital_project_fund_stage = pgEnum("capital_project_fund_stage", ['adopt', 'allocate', 'commit', 'spent']) +export const category = pgEnum("category", ['Residential', 'Commercial', 'Manufacturing']) + + +export const geography_columns = pgTable("geography_columns", { + // TODO: failed to parse database type 'name' + f_table_catalog: unknown("f_table_catalog"), + // TODO: failed to parse database type 'name' + f_table_schema: unknown("f_table_schema"), + // TODO: failed to parse database type 'name' + f_table_name: unknown("f_table_name"), + // TODO: failed to parse database type 'name' + f_geography_column: unknown("f_geography_column"), + coord_dimension: integer("coord_dimension"), + srid: integer("srid"), + type: text("type"), +}); + +export const geometry_columns = pgTable("geometry_columns", { + f_table_catalog: varchar("f_table_catalog", { length: 256 }), + // TODO: failed to parse database type 'name' + f_table_schema: unknown("f_table_schema"), + // TODO: failed to parse database type 'name' + f_table_name: unknown("f_table_name"), + // TODO: failed to parse database type 'name' + f_geometry_column: unknown("f_geometry_column"), + coord_dimension: integer("coord_dimension"), + srid: integer("srid"), + type: varchar("type", { length: 30 }), +}); + +export const spatial_ref_sys = pgTable("spatial_ref_sys", { + srid: integer("srid").primaryKey().notNull(), + auth_name: varchar("auth_name", { length: 256 }), + auth_srid: integer("auth_srid"), + srtext: varchar("srtext", { length: 2048 }), + proj4text: varchar("proj4text", { length: 2048 }), +}); + +export const borough = pgTable("borough", { + id: char("id", { length: 1 }).primaryKey().notNull(), + title: text("title").notNull(), + abbr: text("abbr").notNull(), +}); + +export const tax_lot = pgTable("tax_lot", { + bbl: char("bbl", { length: 10 }).primaryKey().notNull(), + borough_id: char("borough_id", { length: 1 }).notNull().references(() => borough.id), + block: text("block").notNull(), + lot: text("lot").notNull(), + address: text("address"), + land_use_id: char("land_use_id", { length: 2 }).references(() => land_use.id), + // TODO: failed to parse database type 'geography' + wgs84: unknown("wgs84").notNull(), + li_ft: geometry("li_ft", { type: "multipolygon", srid: 2263 }).notNull(), +}); + +export const land_use = pgTable("land_use", { + id: char("id", { length: 2 }).primaryKey().notNull(), + description: text("description").notNull(), + color: char("color", { length: 9 }).notNull(), +}); + +export const zoning_district = pgTable("zoning_district", { + id: uuid("id").defaultRandom().primaryKey().notNull(), + label: text("label").notNull(), + // TODO: failed to parse database type 'geography' + wgs84: unknown("wgs84").notNull(), + li_ft: geometry("li_ft", { type: "multipolygon", srid: 2263 }).notNull(), +}); + +export const zoning_district_zoning_district_class = pgTable("zoning_district_zoning_district_class", { + zoning_district_id: uuid("zoning_district_id").notNull().references(() => zoning_district.id), + zoning_district_class_id: text("zoning_district_class_id").notNull().references(() => zoning_district_class.id), +}); + +export const zoning_district_class = pgTable("zoning_district_class", { + id: text("id").primaryKey().notNull(), + category: category("category"), + description: text("description").notNull(), + url: text("url"), + color: char("color", { length: 9 }).notNull(), +}); + +export const city_council_district = pgTable("city_council_district", { + id: text("id").primaryKey().notNull(), + li_ft: geometry("li_ft", { type: "multipolygon", srid: 2263 }), + mercator_fill: geometry("mercator_fill", { type: "multipolygon", srid: 3857 }), + mercator_label: geometry("mercator_label", { type: "point", srid: 3857 }), +}, +(table) => { + return { + li_ft_idx: index().using("gist", table.li_ft), + mercator_fill_idx: index().using("gist", table.mercator_fill), + mercator_label_idx: index().using("gist", table.mercator_label), + } +}); + +export const agency = pgTable("agency", { + initials: text("initials").primaryKey().notNull(), + name: text("name").notNull(), +}); + +export const agency_budget = pgTable("agency_budget", { + code: text("code").primaryKey().notNull(), + type: text("type"), + sponsor: text("sponsor").references(() => agency.initials), +}); + +export const capital_commitment_fund = pgTable("capital_commitment_fund", { + id: uuid("id").primaryKey().notNull(), + capital_commitment_id: uuid("capital_commitment_id").references(() => capital_commitment.id), + capital_fund_category: capital_fund_category("capital_fund_category"), + value: numeric("value"), +}); + +export const capital_commitment_type = pgTable("capital_commitment_type", { + code: char("code", { length: 4 }).primaryKey().notNull(), + description: text("description"), +}); + +export const capital_project_checkbook = pgTable("capital_project_checkbook", { + id: uuid("id").primaryKey().notNull(), + managing_code: char("managing_code", { length: 3 }), + capital_project_id: text("capital_project_id"), + value: numeric("value"), +}, +(table) => { + return { + custom_fk: foreignKey({ + columns: [table.managing_code, table.capital_project_id], + foreignColumns: [capital_project.managing_code, capital_project.id], + name: "custom_fk" + }), + } +}); + +export const capital_project_fund = pgTable("capital_project_fund", { + id: uuid("id").primaryKey().notNull(), + managing_code: char("managing_code", { length: 3 }), + capital_project_id: text("capital_project_id"), + capital_fund_category: capital_fund_category("capital_fund_category"), + stage: capital_project_fund_stage("stage"), + value: numeric("value"), +}, +(table) => { + return { + custom_fk: foreignKey({ + columns: [table.managing_code, table.capital_project_id], + foreignColumns: [capital_project.managing_code, capital_project.id], + name: "custom_fk" + }), + } +}); + +export const managing_code = pgTable("managing_code", { + id: char("id", { length: 3 }).primaryKey().notNull(), +}); + +export const capital_commitment = pgTable("capital_commitment", { + id: uuid("id").primaryKey().notNull(), + type: char("type", { length: 4 }).references(() => capital_commitment_type.code), + planned_date: date("planned_date"), + managing_code: char("managing_code", { length: 3 }), + capital_project_id: text("capital_project_id"), + budget_line_code: text("budget_line_code"), + budget_line_id: text("budget_line_id"), +}, +(table) => { + return { + capital_commitment_managing_code_capital_project_id_capital_pro: foreignKey({ + columns: [table.managing_code, table.capital_project_id], + foreignColumns: [capital_project.managing_code, capital_project.id], + name: "capital_commitment_managing_code_capital_project_id_capital_pro" + }), + capital_commitment_budget_line_code_budget_line_id_budget_line_: foreignKey({ + columns: [table.budget_line_code, table.budget_line_id], + foreignColumns: [budget_line.code, budget_line.id], + name: "capital_commitment_budget_line_code_budget_line_id_budget_line_" + }), + } +}); + +export const budget_line = pgTable("budget_line", { + code: text("code").notNull().references(() => agency_budget.code), + id: text("id").notNull(), +}, +(table) => { + return { + budget_line_code_id_pk: primaryKey({ columns: [table.code, table.id], name: "budget_line_code_id_pk"}), + } +}); + +export const community_district = pgTable("community_district", { + borough_id: char("borough_id", { length: 1 }).notNull().references(() => borough.id), + id: char("id", { length: 2 }).notNull(), + mercator_fill: geometry("mercator_fill", { type: "multipolygon", srid: 3857 }), + mercator_label: geometry("mercator_label", { type: "point", srid: 3857 }), + li_ft: geometry("li_ft", { type: "multipolygon", srid: 2263 }), +}, +(table) => { + return { + li_ft_idx: index().using("gist", table.li_ft), + mercator_fill_idx: index().using("gist", table.mercator_fill), + mercator_label_idx: index().using("gist", table.mercator_label), + community_district_borough_id_id_pk: primaryKey({ columns: [table.borough_id, table.id], name: "community_district_borough_id_id_pk"}), + } +}); + +export const capital_project = pgTable("capital_project", { + managing_code: char("managing_code", { length: 3 }).notNull().references(() => managing_code.id), + id: text("id").notNull(), + managing_agency: text("managing_agency").notNull().references(() => agency.initials), + description: text("description").notNull(), + min_date: date("min_date").notNull(), + max_date: date("max_date").notNull(), + category: capital_project_category("category"), + li_ft_m_pnt: geometry("li_ft_m_pnt", { type: "multipoint", srid: 2263 }), + li_ft_m_poly: geometry("li_ft_m_poly", { type: "multipolygon", srid: 2263 }), + mercator_label: geometry("mercator_label", { type: "point", srid: 3857 }), + mercator_fill_m_pnt: geometry("mercator_fill_m_pnt", { type: "multipoint", srid: 3857 }), + mercator_fill_m_poly: geometry("mercator_fill_m_poly", { type: "multipolygon", srid: 3857 }), +}, +(table) => { + return { + li_ft_m_pnt_idx: index().using("gist", table.li_ft_m_pnt), + li_ft_m_poly_idx: index().using("gist", table.li_ft_m_poly), + mercator_fill_m_pnt_idx: index().using("gist", table.mercator_fill_m_pnt), + mercator_fill_m_poly_idx: index().using("gist", table.mercator_fill_m_poly), + capital_project_managing_code_id_pk: primaryKey({ columns: [table.managing_code, table.id], name: "capital_project_managing_code_id_pk"}), + } +}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..3f89174 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1279 @@ +{ + "name": "ae-data-flow", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "ae-data-flow", + "version": "0.0.0", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.14.10", + "drizzle-kit": "^0.22.8", + "drizzle-orm": "^0.31.2", + "pg": "^8.12.0" + } + }, + "node_modules/@esbuild-kit/core-utils": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.3.2.tgz", + "integrity": "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.18.20", + "source-map-support": "^0.5.21" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-loong64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-mips64el": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ppc64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-riscv64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-s390x": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/netbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/openbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/sunos-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/esbuild": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" + } + }, + "node_modules/@esbuild-kit/esm-loader": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.6.5.tgz", + "integrity": "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@esbuild-kit/core-utils": "^3.3.2", + "get-tsconfig": "^4.7.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@types/node": { + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/drizzle-kit": { + "version": "0.22.8", + "resolved": "https://registry.npmjs.org/drizzle-kit/-/drizzle-kit-0.22.8.tgz", + "integrity": "sha512-VjI4wsJjk3hSqHSa3TwBf+uvH6M6pRHyxyoVbt935GUzP9tUR/BRZ+MhEJNgryqbzN2Za1KP0eJMTgKEPsalYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@esbuild-kit/esm-loader": "^2.5.5", + "esbuild": "^0.19.7", + "esbuild-register": "^3.5.0" + }, + "bin": { + "drizzle-kit": "bin.cjs" + } + }, + "node_modules/drizzle-orm": { + "version": "0.31.2", + "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.31.2.tgz", + "integrity": "sha512-QnenevbnnAzmbNzQwbhklvIYrDE8YER8K7kSrAWQSV1YvFCdSQPzj+jzqRdTSsV2cDqSpQ0NXGyL1G9I43LDLg==", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "@aws-sdk/client-rds-data": ">=3", + "@cloudflare/workers-types": ">=3", + "@electric-sql/pglite": ">=0.1.1", + "@libsql/client": "*", + "@neondatabase/serverless": ">=0.1", + "@op-engineering/op-sqlite": ">=2", + "@opentelemetry/api": "^1.4.1", + "@planetscale/database": ">=1", + "@tidbcloud/serverless": "*", + "@types/better-sqlite3": "*", + "@types/pg": "*", + "@types/react": ">=18", + "@types/sql.js": "*", + "@vercel/postgres": ">=0.8.0", + "@xata.io/client": "*", + "better-sqlite3": ">=7", + "bun-types": "*", + "expo-sqlite": ">=13.2.0", + "knex": "*", + "kysely": "*", + "mysql2": ">=2", + "pg": ">=8", + "postgres": ">=3", + "react": ">=18", + "sql.js": ">=1", + "sqlite3": ">=5" + }, + "peerDependenciesMeta": { + "@aws-sdk/client-rds-data": { + "optional": true + }, + "@cloudflare/workers-types": { + "optional": true + }, + "@electric-sql/pglite": { + "optional": true + }, + "@libsql/client": { + "optional": true + }, + "@neondatabase/serverless": { + "optional": true + }, + "@op-engineering/op-sqlite": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@planetscale/database": { + "optional": true + }, + "@tidbcloud/serverless": { + "optional": true + }, + "@types/better-sqlite3": { + "optional": true + }, + "@types/pg": { + "optional": true + }, + "@types/react": { + "optional": true + }, + "@types/sql.js": { + "optional": true + }, + "@vercel/postgres": { + "optional": true + }, + "@xata.io/client": { + "optional": true + }, + "better-sqlite3": { + "optional": true + }, + "bun-types": { + "optional": true + }, + "expo-sqlite": { + "optional": true + }, + "knex": { + "optional": true + }, + "kysely": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "pg": { + "optional": true + }, + "postgres": { + "optional": true + }, + "react": { + "optional": true + }, + "sql.js": { + "optional": true + }, + "sqlite3": { + "optional": true + } + } + }, + "node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/esbuild-register": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/esbuild-register/-/esbuild-register-3.5.0.tgz", + "integrity": "sha512-+4G/XmakeBAsvJuDugJvtyF1x+XJT4FMocynNpxrvEBViirpfUn2PgNpCHedfWhF4WokNsO/OvMKrmJOIJsI5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "peerDependencies": { + "esbuild": ">=0.12 <1" + } + }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pg": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.12.0.tgz", + "integrity": "sha512-A+LHUSnwnxrnL/tZ+OLfqR1SxLN3c/pgDztZ47Rpbsd4jUytsTtwQo/TLPRzPJMp/1pbhYVhH9cuSZLAajNfjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "pg-connection-string": "^2.6.4", + "pg-pool": "^3.6.2", + "pg-protocol": "^1.6.1", + "pg-types": "^2.1.0", + "pgpass": "1.x" + }, + "engines": { + "node": ">= 8.0.0" + }, + "optionalDependencies": { + "pg-cloudflare": "^1.1.1" + }, + "peerDependencies": { + "pg-native": ">=3.0.1" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, + "node_modules/pg-cloudflare": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", + "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/pg-connection-string": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.4.tgz", + "integrity": "sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==", + "dev": true, + "license": "MIT" + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-pool": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.2.tgz", + "integrity": "sha512-Htjbg8BlwXqSBQ9V8Vjtc+vzf/6fVUuak/3/XXKA9oxZprwW3IMDQTGHP+KDmVL7rtd+R1QjbnCFPuTHm3G4hg==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "pg": ">=8.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.1.tgz", + "integrity": "sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==", + "dev": true, + "license": "MIT" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "split2": "^4.1.0" + } + }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..704a0d9 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "ae-data-flow", + "version": "0.0.0", + "description": "ETL for application engineering", + "main": "index.js", + "directories": { + "test": "tests" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.14.10", + "drizzle-kit": "^0.22.8", + "drizzle-orm": "^0.31.2", + "pg": "^8.12.0" + } +} diff --git a/sample.env b/sample.env index 06e3536..f69e7a8 100644 --- a/sample.env +++ b/sample.env @@ -1,3 +1,10 @@ +DRIZZLE_DATABASE_USER=postgres +DRIZZLE_DATABASE_PASSWORD=postgres +DRIZZLE_DATABASE_NAME=zoning +DRIZZLE_DATABASE_PORT=8010 +DRIZZLE_DATABASE_HOST=localhost +DRIZZLE_DATABASE_ENV=development + BUILD_ENGINE_HOST=ae-data-flow-db-1 BUILD_ENGINE_PORT=5432 BUILD_ENGINE_USER=postgres