spb/datacenterindex
Public
HTML 53.9%
TypeScript 44.5%
JavaScript 0.6%
SQL 0.5%
1CREATE TABLE "admin_sessions" (2 "id" text PRIMARY KEY NOT NULL,3 "created_at" timestamp with time zone DEFAULT now() NOT NULL,4 "expires_at" timestamp with time zone NOT NULL,5 "ip" text,6 "user_agent" text7);8--> statement-breakpoint9CREATE TABLE "campuses" (10 "id" text PRIMARY KEY NOT NULL,11 "slug" text NOT NULL,12 "name" text NOT NULL,13 "operator_id" text,14 "metro_id" text,15 "country_iso2" text,16 "city" text,17 "lat" double precision,18 "lng" double precision,19 "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL,20 "created_at" timestamp with time zone DEFAULT now() NOT NULL,21 "updated_at" timestamp with time zone DEFAULT now() NOT NULL,22 CONSTRAINT "campuses_slug_unique" UNIQUE("slug")23);24--> statement-breakpoint25CREATE TABLE "cloud_regions" (26 "id" text PRIMARY KEY NOT NULL,27 "slug" text NOT NULL,28 "provider_id" text NOT NULL,29 "code" text NOT NULL,30 "name" text NOT NULL,31 "city" text,32 "region_name" text,33 "country_iso2" text,34 "metro_id" text,35 "lat" double precision,36 "lng" double precision,37 "geo_precision" text DEFAULT 'city' NOT NULL,38 "availability_zones" integer,39 "launched_on" text,40 "status" text DEFAULT 'operational' NOT NULL,41 "is_sovereign" boolean DEFAULT false NOT NULL,42 "source_url" text,43 "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL,44 "created_at" timestamp with time zone DEFAULT now() NOT NULL,45 "updated_at" timestamp with time zone DEFAULT now() NOT NULL,46 CONSTRAINT "cloud_regions_slug_unique" UNIQUE("slug")47);48--> statement-breakpoint49CREATE TABLE "connector_runs" (50 "id" text PRIMARY KEY NOT NULL,51 "connector_id" text NOT NULL,52 "task" text DEFAULT 'crawl' NOT NULL,53 "started_at" timestamp with time zone DEFAULT now() NOT NULL,54 "finished_at" timestamp with time zone,55 "status" text DEFAULT 'running' NOT NULL,56 "stats" jsonb DEFAULT '{}'::jsonb NOT NULL,57 "error" text,58 "log" jsonb DEFAULT '[]'::jsonb NOT NULL59);60--> statement-breakpoint61CREATE TABLE "connectors" (62 "id" text PRIMARY KEY NOT NULL,63 "source_name" text NOT NULL,64 "domain" text NOT NULL,65 "kind" text NOT NULL,66 "mode" text NOT NULL,67 "enabled" boolean DEFAULT true NOT NULL,68 "paused" boolean DEFAULT false NOT NULL,69 "config" jsonb DEFAULT '{}'::jsonb NOT NULL,70 "parser_version" text DEFAULT 'v1' NOT NULL,71 "schedule" jsonb DEFAULT '{}'::jsonb NOT NULL,72 "health" text DEFAULT 'never_run' NOT NULL,73 "last_run_at" timestamp with time zone,74 "last_status" text,75 "last_error" text,76 "next_run_at" timestamp with time zone,77 "stats" jsonb DEFAULT '{}'::jsonb NOT NULL,78 "created_at" timestamp with time zone DEFAULT now() NOT NULL,79 "updated_at" timestamp with time zone DEFAULT now() NOT NULL80);81--> statement-breakpoint82CREATE TABLE "countries" (83 "iso2" text PRIMARY KEY NOT NULL,84 "iso3" text,85 "slug" text NOT NULL,86 "name" text NOT NULL,87 "region" text,88 "subregion" text,89 "population" bigint,90 "gdp_usd" double precision,91 "electricity_twh" double precision,92 "renewable_share" double precision,93 "stats_year" integer,94 "lat" double precision,95 "lng" double precision,96 "stats" jsonb DEFAULT '{}'::jsonb NOT NULL,97 "updated_at" timestamp with time zone DEFAULT now() NOT NULL,98 CONSTRAINT "countries_slug_unique" UNIQUE("slug")99);100--> statement-breakpoint101CREATE TABLE "daily_metrics" (102 "day" date NOT NULL,103 "metric" text NOT NULL,104 "dim" text DEFAULT 'global' NOT NULL,105 "value" double precision NOT NULL,106 CONSTRAINT "daily_metrics_day_metric_dim_pk" PRIMARY KEY("day","metric","dim")107);108--> statement-breakpoint109CREATE TABLE "document_versions" (110 "id" text PRIMARY KEY NOT NULL,111 "document_id" text NOT NULL,112 "content_hash" text NOT NULL,113 "fetched_at" timestamp with time zone DEFAULT now() NOT NULL,114 "fetch_level" integer DEFAULT 1 NOT NULL,115 "status_code" integer,116 "size_bytes" integer,117 "storage_key" text,118 "diff_summary" jsonb,119 "detected_changes" jsonb DEFAULT '[]'::jsonb NOT NULL,120 "significance" integer DEFAULT 0 NOT NULL121);122--> statement-breakpoint123CREATE TABLE "documents" (124 "id" text PRIMARY KEY NOT NULL,125 "connector_id" text NOT NULL,126 "source_id" text NOT NULL,127 "url" text NOT NULL,128 "canonical_url" text NOT NULL,129 "url_fingerprint" text NOT NULL,130 "page_type" text DEFAULT 'unknown' NOT NULL,131 "classifier" text,132 "fetch_level" integer DEFAULT 1 NOT NULL,133 "priority" integer DEFAULT 50 NOT NULL,134 "content_hash" text,135 "etag" text,136 "last_modified" text,137 "status_code" integer,138 "content_type" text,139 "size_bytes" integer,140 "title" text,141 "storage_key" text,142 "extractor_version" text,143 "extract_ok" boolean,144 "extract_count" integer DEFAULT 0 NOT NULL,145 "error" text,146 "error_count" integer DEFAULT 0 NOT NULL,147 "first_seen" timestamp with time zone DEFAULT now() NOT NULL,148 "last_fetched" timestamp with time zone,149 "last_changed" timestamp with time zone,150 "last_checked" timestamp with time zone,151 "next_check" timestamp with time zone,152 "change_frequency_score" real DEFAULT 0.5 NOT NULL,153 "fetch_count" integer DEFAULT 0 NOT NULL,154 "change_count" integer DEFAULT 0 NOT NULL,155 "discovered_from" text,156 "quarantined" boolean DEFAULT false NOT NULL,157 "entity_refs" jsonb DEFAULT '[]'::jsonb NOT NULL,158 "updated_at" timestamp with time zone DEFAULT now() NOT NULL159);160--> statement-breakpoint161CREATE TABLE "entity_keys" (162 "key" text PRIMARY KEY NOT NULL,163 "entity_type" text NOT NULL,164 "entity_id" text NOT NULL,165 "connector_id" text NOT NULL,166 "created_at" timestamp with time zone DEFAULT now() NOT NULL167);168--> statement-breakpoint169CREATE TABLE "entity_matches" (170 "id" text PRIMARY KEY NOT NULL,171 "connector_id" text NOT NULL,172 "candidate_key" text NOT NULL,173 "candidate" jsonb NOT NULL,174 "matched_facility_id" text,175 "score" real NOT NULL,176 "reasons" text[] DEFAULT '{}'::text[] NOT NULL,177 "status" text DEFAULT 'pending' NOT NULL,178 "decided_by" text,179 "decided_at" timestamp with time zone,180 "created_at" timestamp with time zone DEFAULT now() NOT NULL181);182--> statement-breakpoint183CREATE TABLE "events" (184 "id" text PRIMARY KEY NOT NULL,185 "entity_type" text NOT NULL,186 "entity_id" text,187 "event_type" text NOT NULL,188 "detected_at" timestamp with time zone DEFAULT now() NOT NULL,189 "effective_date" text,190 "old_value" jsonb,191 "new_value" jsonb,192 "source_id" text NOT NULL,193 "document_id" text,194 "url" text NOT NULL,195 "title" text NOT NULL,196 "summary" text,197 "significance" integer DEFAULT 30 NOT NULL,198 "confidence" text DEFAULT 'moderate' NOT NULL,199 "review_status" text DEFAULT 'auto' NOT NULL,200 "country_iso2" text,201 "operator_id" text,202 "metro_id" text,203 "project_id" text,204 "fingerprint" text NOT NULL205);206--> statement-breakpoint207CREATE TABLE "facilities" (208 "id" text PRIMARY KEY NOT NULL,209 "slug" text NOT NULL,210 "name" text NOT NULL,211 "normalized_name" text NOT NULL,212 "operator_id" text,213 "owner_id" text,214 "campus_id" text,215 "metro_id" text,216 "country_iso2" text,217 "city" text,218 "region_name" text,219 "address" text,220 "postal_code" text,221 "lat" double precision,222 "lng" double precision,223 "geo_precision" text DEFAULT 'unknown' NOT NULL,224 "geo_source" text,225 "geohash" text,226 "status" text DEFAULT 'unknown' NOT NULL,227 "facility_type" text DEFAULT 'unknown' NOT NULL,228 "tier" text,229 "building_sqm" double precision,230 "site_area_ha" double precision,231 "it_capacity_mw" double precision,232 "total_power_mw" double precision,233 "planned_power_mw" double precision,234 "mw_is_estimate" boolean DEFAULT false NOT NULL,235 "rack_count" integer,236 "pue" real,237 "cooling_type" text,238 "renewable_claim" text,239 "opened_on" text,240 "construction_started_on" text,241 "announced_on" text,242 "website" text,243 "description" text,244 "is_ai" boolean DEFAULT false NOT NULL,245 "is_hyperscale" boolean DEFAULT false NOT NULL,246 "certifications" text[] DEFAULT '{}'::text[] NOT NULL,247 "carriers_count" integer,248 "ixp_count" integer,249 "networks_count" integer,250 "confidence" text DEFAULT 'unverified' NOT NULL,251 "completeness" integer DEFAULT 0 NOT NULL,252 "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL,253 "source_count" integer DEFAULT 0 NOT NULL,254 "first_seen" timestamp with time zone DEFAULT now() NOT NULL,255 "last_verified" timestamp with time zone,256 "merged_into" text,257 "created_at" timestamp with time zone DEFAULT now() NOT NULL,258 "updated_at" timestamp with time zone DEFAULT now() NOT NULL,259 CONSTRAINT "facilities_slug_unique" UNIQUE("slug")260);261--> statement-breakpoint262CREATE TABLE "facility_aliases" (263 "facility_id" text NOT NULL,264 "alias" text NOT NULL,265 "normalized" text NOT NULL,266 "source_id" text,267 CONSTRAINT "facility_aliases_facility_id_alias_pk" PRIMARY KEY("facility_id","alias")268);269--> statement-breakpoint270CREATE TABLE "facility_ixps" (271 "facility_id" text NOT NULL,272 "ixp_id" text NOT NULL,273 "source_id" text,274 CONSTRAINT "facility_ixps_facility_id_ixp_id_pk" PRIMARY KEY("facility_id","ixp_id")275);276--> statement-breakpoint277CREATE TABLE "facility_tenants" (278 "facility_id" text NOT NULL,279 "operator_id" text NOT NULL,280 "role" text DEFAULT 'carrier' NOT NULL,281 "asn" integer,282 "source_id" text,283 CONSTRAINT "facility_tenants_facility_id_operator_id_role_pk" PRIMARY KEY("facility_id","operator_id","role")284);285--> statement-breakpoint286CREATE TABLE "ixps" (287 "id" text PRIMARY KEY NOT NULL,288 "slug" text NOT NULL,289 "name" text NOT NULL,290 "name_long" text,291 "city" text,292 "country_iso2" text,293 "metro_id" text,294 "region_continent" text,295 "website" text,296 "network_count" integer,297 "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL,298 "created_at" timestamp with time zone DEFAULT now() NOT NULL,299 "updated_at" timestamp with time zone DEFAULT now() NOT NULL,300 CONSTRAINT "ixps_slug_unique" UNIQUE("slug")301);302--> statement-breakpoint303CREATE TABLE "metros" (304 "id" text PRIMARY KEY NOT NULL,305 "slug" text NOT NULL,306 "name" text NOT NULL,307 "country_iso2" text NOT NULL,308 "region_name" text,309 "lat" double precision NOT NULL,310 "lng" double precision NOT NULL,311 "radius_km" real DEFAULT 60 NOT NULL,312 "aliases" text[] DEFAULT '{}'::text[] NOT NULL,313 "description" text,314 "stats" jsonb DEFAULT '{}'::jsonb NOT NULL,315 "created_at" timestamp with time zone DEFAULT now() NOT NULL,316 "updated_at" timestamp with time zone DEFAULT now() NOT NULL,317 CONSTRAINT "metros_slug_unique" UNIQUE("slug")318);319--> statement-breakpoint320CREATE TABLE "news_items" (321 "id" text PRIMARY KEY NOT NULL,322 "source_id" text NOT NULL,323 "connector_id" text NOT NULL,324 "url" text NOT NULL,325 "title" text NOT NULL,326 "published_at" timestamp with time zone,327 "summary" text,328 "page_type" text DEFAULT 'unknown' NOT NULL,329 "event_type" text,330 "mentions" jsonb DEFAULT '{}'::jsonb NOT NULL,331 "operator_ids" text[] DEFAULT '{}'::text[] NOT NULL,332 "country_iso2s" text[] DEFAULT '{}'::text[] NOT NULL,333 "facility_ids" text[] DEFAULT '{}'::text[] NOT NULL,334 "project_id" text,335 "mw" double precision,336 "significance" integer DEFAULT 20 NOT NULL,337 "created_at" timestamp with time zone DEFAULT now() NOT NULL,338 CONSTRAINT "news_items_url_unique" UNIQUE("url")339);340--> statement-breakpoint341CREATE TABLE "operators" (342 "id" text PRIMARY KEY NOT NULL,343 "slug" text NOT NULL,344 "name" text NOT NULL,345 "normalized_name" text NOT NULL,346 "kind" text,347 "website" text,348 "hq_country_iso2" text,349 "hq_city" text,350 "parent_id" text,351 "description" text,352 "aliases" text[] DEFAULT '{}'::text[] NOT NULL,353 "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL,354 "is_cloud_provider" boolean DEFAULT false NOT NULL,355 "is_carrier" boolean DEFAULT false NOT NULL,356 "stats" jsonb DEFAULT '{}'::jsonb NOT NULL,357 "created_at" timestamp with time zone DEFAULT now() NOT NULL,358 "updated_at" timestamp with time zone DEFAULT now() NOT NULL,359 CONSTRAINT "operators_slug_unique" UNIQUE("slug")360);361--> statement-breakpoint362CREATE TABLE "project_timeline" (363 "id" text PRIMARY KEY NOT NULL,364 "project_id" text NOT NULL,365 "event_date" text NOT NULL,366 "event_type" text NOT NULL,367 "description" text NOT NULL,368 "source_id" text,369 "document_id" text,370 "url" text,371 "created_at" timestamp with time zone DEFAULT now() NOT NULL372);373--> statement-breakpoint374CREATE TABLE "projects" (375 "id" text PRIMARY KEY NOT NULL,376 "slug" text NOT NULL,377 "name" text NOT NULL,378 "normalized_name" text NOT NULL,379 "operator_id" text,380 "facility_id" text,381 "metro_id" text,382 "country_iso2" text,383 "city" text,384 "region_name" text,385 "lat" double precision,386 "lng" double precision,387 "geo_precision" text DEFAULT 'unknown' NOT NULL,388 "status" text DEFAULT 'announced' NOT NULL,389 "announced_on" text,390 "expected_opening" text,391 "planned_mw" double precision,392 "investment_usd" double precision,393 "investment_currency" text,394 "investment_original" double precision,395 "acreage" double precision,396 "phase_count" integer,397 "is_ai" boolean DEFAULT false NOT NULL,398 "description" text,399 "source_url" text,400 "confidence" text DEFAULT 'moderate' NOT NULL,401 "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL,402 "last_update" timestamp with time zone DEFAULT now() NOT NULL,403 "created_at" timestamp with time zone DEFAULT now() NOT NULL,404 "updated_at" timestamp with time zone DEFAULT now() NOT NULL,405 CONSTRAINT "projects_slug_unique" UNIQUE("slug")406);407--> statement-breakpoint408CREATE TABLE "provenance" (409 "id" text PRIMARY KEY NOT NULL,410 "entity_type" text NOT NULL,411 "entity_id" text NOT NULL,412 "field" text NOT NULL,413 "value" jsonb,414 "source_id" text NOT NULL,415 "connector_id" text NOT NULL,416 "document_id" text,417 "url" text NOT NULL,418 "first_observed" timestamp with time zone DEFAULT now() NOT NULL,419 "last_observed" timestamp with time zone DEFAULT now() NOT NULL,420 "retrieved_at" timestamp with time zone DEFAULT now() NOT NULL,421 "confidence" text DEFAULT 'moderate' NOT NULL,422 "is_estimate" boolean DEFAULT false NOT NULL,423 "method" text,424 "extractor_version" text,425 "is_current" boolean DEFAULT true NOT NULL,426 "note" text427);428--> statement-breakpoint429CREATE TABLE "rankings" (430 "id" text PRIMARY KEY NOT NULL,431 "key" text NOT NULL,432 "scope" text NOT NULL,433 "label" text NOT NULL,434 "unit" text NOT NULL,435 "methodology" text NOT NULL,436 "min_coverage" real,437 "rows" jsonb NOT NULL,438 "total" integer NOT NULL,439 "computed_at" timestamp with time zone DEFAULT now() NOT NULL,440 "is_current" boolean DEFAULT true NOT NULL441);442--> statement-breakpoint443CREATE TABLE "sources" (444 "id" text PRIMARY KEY NOT NULL,445 "connector_id" text NOT NULL,446 "name" text NOT NULL,447 "domain" text NOT NULL,448 "kind" text NOT NULL,449 "priority" integer DEFAULT 3 NOT NULL,450 "url" text,451 "license" text,452 "attribution" text,453 "robots_allowed" boolean,454 "notes" text,455 "created_at" timestamp with time zone DEFAULT now() NOT NULL,456 "updated_at" timestamp with time zone DEFAULT now() NOT NULL457);458--> statement-breakpoint459CREATE TABLE "system_alerts" (460 "id" text PRIMARY KEY NOT NULL,461 "level" text NOT NULL,462 "component" text NOT NULL,463 "message" text NOT NULL,464 "details" jsonb,465 "resolved_at" timestamp with time zone,466 "created_at" timestamp with time zone DEFAULT now() NOT NULL467);468--> statement-breakpoint469ALTER TABLE "campuses" ADD CONSTRAINT "campuses_operator_id_operators_id_fk" FOREIGN KEY ("operator_id") REFERENCES "public"."operators"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint470ALTER TABLE "campuses" ADD CONSTRAINT "campuses_metro_id_metros_id_fk" FOREIGN KEY ("metro_id") REFERENCES "public"."metros"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint471ALTER TABLE "cloud_regions" ADD CONSTRAINT "cloud_regions_provider_id_operators_id_fk" FOREIGN KEY ("provider_id") REFERENCES "public"."operators"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint472ALTER TABLE "cloud_regions" ADD CONSTRAINT "cloud_regions_country_iso2_countries_iso2_fk" FOREIGN KEY ("country_iso2") REFERENCES "public"."countries"("iso2") ON DELETE no action ON UPDATE no action;--> statement-breakpoint473ALTER TABLE "cloud_regions" ADD CONSTRAINT "cloud_regions_metro_id_metros_id_fk" FOREIGN KEY ("metro_id") REFERENCES "public"."metros"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint474ALTER TABLE "document_versions" ADD CONSTRAINT "document_versions_document_id_documents_id_fk" FOREIGN KEY ("document_id") REFERENCES "public"."documents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint475ALTER TABLE "facilities" ADD CONSTRAINT "facilities_operator_id_operators_id_fk" FOREIGN KEY ("operator_id") REFERENCES "public"."operators"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint476ALTER TABLE "facilities" ADD CONSTRAINT "facilities_owner_id_operators_id_fk" FOREIGN KEY ("owner_id") REFERENCES "public"."operators"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint477ALTER TABLE "facilities" ADD CONSTRAINT "facilities_campus_id_campuses_id_fk" FOREIGN KEY ("campus_id") REFERENCES "public"."campuses"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint478ALTER TABLE "facilities" ADD CONSTRAINT "facilities_metro_id_metros_id_fk" FOREIGN KEY ("metro_id") REFERENCES "public"."metros"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint479ALTER TABLE "facilities" ADD CONSTRAINT "facilities_country_iso2_countries_iso2_fk" FOREIGN KEY ("country_iso2") REFERENCES "public"."countries"("iso2") ON DELETE no action ON UPDATE no action;--> statement-breakpoint480ALTER TABLE "facility_aliases" ADD CONSTRAINT "facility_aliases_facility_id_facilities_id_fk" FOREIGN KEY ("facility_id") REFERENCES "public"."facilities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint481ALTER TABLE "facility_ixps" ADD CONSTRAINT "facility_ixps_facility_id_facilities_id_fk" FOREIGN KEY ("facility_id") REFERENCES "public"."facilities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint482ALTER TABLE "facility_ixps" ADD CONSTRAINT "facility_ixps_ixp_id_ixps_id_fk" FOREIGN KEY ("ixp_id") REFERENCES "public"."ixps"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint483ALTER TABLE "facility_tenants" ADD CONSTRAINT "facility_tenants_facility_id_facilities_id_fk" FOREIGN KEY ("facility_id") REFERENCES "public"."facilities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint484ALTER TABLE "facility_tenants" ADD CONSTRAINT "facility_tenants_operator_id_operators_id_fk" FOREIGN KEY ("operator_id") REFERENCES "public"."operators"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint485ALTER TABLE "ixps" ADD CONSTRAINT "ixps_country_iso2_countries_iso2_fk" FOREIGN KEY ("country_iso2") REFERENCES "public"."countries"("iso2") ON DELETE no action ON UPDATE no action;--> statement-breakpoint486ALTER TABLE "ixps" ADD CONSTRAINT "ixps_metro_id_metros_id_fk" FOREIGN KEY ("metro_id") REFERENCES "public"."metros"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint487ALTER TABLE "metros" ADD CONSTRAINT "metros_country_iso2_countries_iso2_fk" FOREIGN KEY ("country_iso2") REFERENCES "public"."countries"("iso2") ON DELETE no action ON UPDATE no action;--> statement-breakpoint488ALTER TABLE "project_timeline" ADD CONSTRAINT "project_timeline_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint489ALTER TABLE "projects" ADD CONSTRAINT "projects_operator_id_operators_id_fk" FOREIGN KEY ("operator_id") REFERENCES "public"."operators"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint490ALTER TABLE "projects" ADD CONSTRAINT "projects_facility_id_facilities_id_fk" FOREIGN KEY ("facility_id") REFERENCES "public"."facilities"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint491ALTER TABLE "projects" ADD CONSTRAINT "projects_metro_id_metros_id_fk" FOREIGN KEY ("metro_id") REFERENCES "public"."metros"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint492ALTER TABLE "projects" ADD CONSTRAINT "projects_country_iso2_countries_iso2_fk" FOREIGN KEY ("country_iso2") REFERENCES "public"."countries"("iso2") ON DELETE no action ON UPDATE no action;--> statement-breakpoint493CREATE UNIQUE INDEX "cloud_regions_provider_code_uq" ON "cloud_regions" USING btree ("provider_id","code");--> statement-breakpoint494CREATE INDEX "cloud_regions_country_idx" ON "cloud_regions" USING btree ("country_iso2");--> statement-breakpoint495CREATE INDEX "connector_runs_connector_idx" ON "connector_runs" USING btree ("connector_id","started_at");--> statement-breakpoint496CREATE INDEX "document_versions_doc_idx" ON "document_versions" USING btree ("document_id","fetched_at");--> statement-breakpoint497CREATE UNIQUE INDEX "documents_fingerprint_uq" ON "documents" USING btree ("url_fingerprint");--> statement-breakpoint498CREATE INDEX "documents_connector_idx" ON "documents" USING btree ("connector_id");--> statement-breakpoint499CREATE INDEX "documents_next_check_idx" ON "documents" USING btree ("next_check");--> statement-breakpoint500CREATE INDEX "documents_page_type_idx" ON "documents" USING btree ("page_type");--> statement-breakpoint501CREATE INDEX "entity_keys_entity_idx" ON "entity_keys" USING btree ("entity_type","entity_id");--> statement-breakpoint502CREATE INDEX "entity_matches_status_idx" ON "entity_matches" USING btree ("status");--> statement-breakpoint503CREATE INDEX "entity_matches_key_idx" ON "entity_matches" USING btree ("candidate_key");--> statement-breakpoint504CREATE UNIQUE INDEX "events_fingerprint_uq" ON "events" USING btree ("fingerprint");--> statement-breakpoint505CREATE INDEX "events_detected_idx" ON "events" USING btree ("detected_at");--> statement-breakpoint506CREATE INDEX "events_entity_idx" ON "events" USING btree ("entity_type","entity_id");--> statement-breakpoint507CREATE INDEX "events_country_idx" ON "events" USING btree ("country_iso2");--> statement-breakpoint508CREATE INDEX "events_operator_idx" ON "events" USING btree ("operator_id");--> statement-breakpoint509CREATE INDEX "events_type_idx" ON "events" USING btree ("event_type");--> statement-breakpoint510CREATE INDEX "facilities_country_idx" ON "facilities" USING btree ("country_iso2");--> statement-breakpoint511CREATE INDEX "facilities_operator_idx" ON "facilities" USING btree ("operator_id");--> statement-breakpoint512CREATE INDEX "facilities_metro_idx" ON "facilities" USING btree ("metro_id");--> statement-breakpoint513CREATE INDEX "facilities_status_idx" ON "facilities" USING btree ("status");--> statement-breakpoint514CREATE INDEX "facilities_type_idx" ON "facilities" USING btree ("facility_type");--> statement-breakpoint515CREATE INDEX "facilities_geohash_idx" ON "facilities" USING btree ("geohash");--> statement-breakpoint516CREATE INDEX "facilities_norm_idx" ON "facilities" USING btree ("normalized_name");--> statement-breakpoint517CREATE INDEX "facilities_updated_idx" ON "facilities" USING btree ("updated_at");--> statement-breakpoint518CREATE INDEX "facility_aliases_norm_idx" ON "facility_aliases" USING btree ("normalized");--> statement-breakpoint519CREATE INDEX "facility_tenants_operator_idx" ON "facility_tenants" USING btree ("operator_id");--> statement-breakpoint520CREATE INDEX "metros_country_idx" ON "metros" USING btree ("country_iso2");--> statement-breakpoint521CREATE INDEX "news_items_published_idx" ON "news_items" USING btree ("published_at");--> statement-breakpoint522CREATE INDEX "operators_norm_idx" ON "operators" USING btree ("normalized_name");--> statement-breakpoint523CREATE INDEX "operators_kind_idx" ON "operators" USING btree ("kind");--> statement-breakpoint524CREATE INDEX "project_timeline_project_idx" ON "project_timeline" USING btree ("project_id");--> statement-breakpoint525CREATE INDEX "projects_country_idx" ON "projects" USING btree ("country_iso2");--> statement-breakpoint526CREATE INDEX "projects_operator_idx" ON "projects" USING btree ("operator_id");--> statement-breakpoint527CREATE INDEX "projects_status_idx" ON "projects" USING btree ("status");--> statement-breakpoint528CREATE INDEX "projects_norm_idx" ON "projects" USING btree ("normalized_name");--> statement-breakpoint529CREATE INDEX "provenance_entity_idx" ON "provenance" USING btree ("entity_type","entity_id");--> statement-breakpoint530CREATE INDEX "provenance_source_idx" ON "provenance" USING btree ("source_id");--> statement-breakpoint531CREATE UNIQUE INDEX "provenance_uq" ON "provenance" USING btree ("entity_type","entity_id","field","source_id","url");--> statement-breakpoint532CREATE INDEX "rankings_key_idx" ON "rankings" USING btree ("key","is_current");