CREATE TABLE "admin_sessions" ( "id" text PRIMARY KEY NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "expires_at" timestamp with time zone NOT NULL, "ip" text, "user_agent" text ); --> statement-breakpoint CREATE TABLE "campuses" ( "id" text PRIMARY KEY NOT NULL, "slug" text NOT NULL, "name" text NOT NULL, "operator_id" text, "metro_id" text, "country_iso2" text, "city" text, "lat" double precision, "lng" double precision, "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "campuses_slug_unique" UNIQUE("slug") ); --> statement-breakpoint CREATE TABLE "cloud_regions" ( "id" text PRIMARY KEY NOT NULL, "slug" text NOT NULL, "provider_id" text NOT NULL, "code" text NOT NULL, "name" text NOT NULL, "city" text, "region_name" text, "country_iso2" text, "metro_id" text, "lat" double precision, "lng" double precision, "geo_precision" text DEFAULT 'city' NOT NULL, "availability_zones" integer, "launched_on" text, "status" text DEFAULT 'operational' NOT NULL, "is_sovereign" boolean DEFAULT false NOT NULL, "source_url" text, "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "cloud_regions_slug_unique" UNIQUE("slug") ); --> statement-breakpoint CREATE TABLE "connector_runs" ( "id" text PRIMARY KEY NOT NULL, "connector_id" text NOT NULL, "task" text DEFAULT 'crawl' NOT NULL, "started_at" timestamp with time zone DEFAULT now() NOT NULL, "finished_at" timestamp with time zone, "status" text DEFAULT 'running' NOT NULL, "stats" jsonb DEFAULT '{}'::jsonb NOT NULL, "error" text, "log" jsonb DEFAULT '[]'::jsonb NOT NULL ); --> statement-breakpoint CREATE TABLE "connectors" ( "id" text PRIMARY KEY NOT NULL, "source_name" text NOT NULL, "domain" text NOT NULL, "kind" text NOT NULL, "mode" text NOT NULL, "enabled" boolean DEFAULT true NOT NULL, "paused" boolean DEFAULT false NOT NULL, "config" jsonb DEFAULT '{}'::jsonb NOT NULL, "parser_version" text DEFAULT 'v1' NOT NULL, "schedule" jsonb DEFAULT '{}'::jsonb NOT NULL, "health" text DEFAULT 'never_run' NOT NULL, "last_run_at" timestamp with time zone, "last_status" text, "last_error" text, "next_run_at" timestamp with time zone, "stats" jsonb DEFAULT '{}'::jsonb NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL ); --> statement-breakpoint CREATE TABLE "countries" ( "iso2" text PRIMARY KEY NOT NULL, "iso3" text, "slug" text NOT NULL, "name" text NOT NULL, "region" text, "subregion" text, "population" bigint, "gdp_usd" double precision, "electricity_twh" double precision, "renewable_share" double precision, "stats_year" integer, "lat" double precision, "lng" double precision, "stats" jsonb DEFAULT '{}'::jsonb NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "countries_slug_unique" UNIQUE("slug") ); --> statement-breakpoint CREATE TABLE "daily_metrics" ( "day" date NOT NULL, "metric" text NOT NULL, "dim" text DEFAULT 'global' NOT NULL, "value" double precision NOT NULL, CONSTRAINT "daily_metrics_day_metric_dim_pk" PRIMARY KEY("day","metric","dim") ); --> statement-breakpoint CREATE TABLE "document_versions" ( "id" text PRIMARY KEY NOT NULL, "document_id" text NOT NULL, "content_hash" text NOT NULL, "fetched_at" timestamp with time zone DEFAULT now() NOT NULL, "fetch_level" integer DEFAULT 1 NOT NULL, "status_code" integer, "size_bytes" integer, "storage_key" text, "diff_summary" jsonb, "detected_changes" jsonb DEFAULT '[]'::jsonb NOT NULL, "significance" integer DEFAULT 0 NOT NULL ); --> statement-breakpoint CREATE TABLE "documents" ( "id" text PRIMARY KEY NOT NULL, "connector_id" text NOT NULL, "source_id" text NOT NULL, "url" text NOT NULL, "canonical_url" text NOT NULL, "url_fingerprint" text NOT NULL, "page_type" text DEFAULT 'unknown' NOT NULL, "classifier" text, "fetch_level" integer DEFAULT 1 NOT NULL, "priority" integer DEFAULT 50 NOT NULL, "content_hash" text, "etag" text, "last_modified" text, "status_code" integer, "content_type" text, "size_bytes" integer, "title" text, "storage_key" text, "extractor_version" text, "extract_ok" boolean, "extract_count" integer DEFAULT 0 NOT NULL, "error" text, "error_count" integer DEFAULT 0 NOT NULL, "first_seen" timestamp with time zone DEFAULT now() NOT NULL, "last_fetched" timestamp with time zone, "last_changed" timestamp with time zone, "last_checked" timestamp with time zone, "next_check" timestamp with time zone, "change_frequency_score" real DEFAULT 0.5 NOT NULL, "fetch_count" integer DEFAULT 0 NOT NULL, "change_count" integer DEFAULT 0 NOT NULL, "discovered_from" text, "quarantined" boolean DEFAULT false NOT NULL, "entity_refs" jsonb DEFAULT '[]'::jsonb NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL ); --> statement-breakpoint CREATE TABLE "entity_keys" ( "key" text PRIMARY KEY NOT NULL, "entity_type" text NOT NULL, "entity_id" text NOT NULL, "connector_id" text NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL ); --> statement-breakpoint CREATE TABLE "entity_matches" ( "id" text PRIMARY KEY NOT NULL, "connector_id" text NOT NULL, "candidate_key" text NOT NULL, "candidate" jsonb NOT NULL, "matched_facility_id" text, "score" real NOT NULL, "reasons" text[] DEFAULT '{}'::text[] NOT NULL, "status" text DEFAULT 'pending' NOT NULL, "decided_by" text, "decided_at" timestamp with time zone, "created_at" timestamp with time zone DEFAULT now() NOT NULL ); --> statement-breakpoint CREATE TABLE "events" ( "id" text PRIMARY KEY NOT NULL, "entity_type" text NOT NULL, "entity_id" text, "event_type" text NOT NULL, "detected_at" timestamp with time zone DEFAULT now() NOT NULL, "effective_date" text, "old_value" jsonb, "new_value" jsonb, "source_id" text NOT NULL, "document_id" text, "url" text NOT NULL, "title" text NOT NULL, "summary" text, "significance" integer DEFAULT 30 NOT NULL, "confidence" text DEFAULT 'moderate' NOT NULL, "review_status" text DEFAULT 'auto' NOT NULL, "country_iso2" text, "operator_id" text, "metro_id" text, "project_id" text, "fingerprint" text NOT NULL ); --> statement-breakpoint CREATE TABLE "facilities" ( "id" text PRIMARY KEY NOT NULL, "slug" text NOT NULL, "name" text NOT NULL, "normalized_name" text NOT NULL, "operator_id" text, "owner_id" text, "campus_id" text, "metro_id" text, "country_iso2" text, "city" text, "region_name" text, "address" text, "postal_code" text, "lat" double precision, "lng" double precision, "geo_precision" text DEFAULT 'unknown' NOT NULL, "geo_source" text, "geohash" text, "status" text DEFAULT 'unknown' NOT NULL, "facility_type" text DEFAULT 'unknown' NOT NULL, "tier" text, "building_sqm" double precision, "site_area_ha" double precision, "it_capacity_mw" double precision, "total_power_mw" double precision, "planned_power_mw" double precision, "mw_is_estimate" boolean DEFAULT false NOT NULL, "rack_count" integer, "pue" real, "cooling_type" text, "renewable_claim" text, "opened_on" text, "construction_started_on" text, "announced_on" text, "website" text, "description" text, "is_ai" boolean DEFAULT false NOT NULL, "is_hyperscale" boolean DEFAULT false NOT NULL, "certifications" text[] DEFAULT '{}'::text[] NOT NULL, "carriers_count" integer, "ixp_count" integer, "networks_count" integer, "confidence" text DEFAULT 'unverified' NOT NULL, "completeness" integer DEFAULT 0 NOT NULL, "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL, "source_count" integer DEFAULT 0 NOT NULL, "first_seen" timestamp with time zone DEFAULT now() NOT NULL, "last_verified" timestamp with time zone, "merged_into" text, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "facilities_slug_unique" UNIQUE("slug") ); --> statement-breakpoint CREATE TABLE "facility_aliases" ( "facility_id" text NOT NULL, "alias" text NOT NULL, "normalized" text NOT NULL, "source_id" text, CONSTRAINT "facility_aliases_facility_id_alias_pk" PRIMARY KEY("facility_id","alias") ); --> statement-breakpoint CREATE TABLE "facility_ixps" ( "facility_id" text NOT NULL, "ixp_id" text NOT NULL, "source_id" text, CONSTRAINT "facility_ixps_facility_id_ixp_id_pk" PRIMARY KEY("facility_id","ixp_id") ); --> statement-breakpoint CREATE TABLE "facility_tenants" ( "facility_id" text NOT NULL, "operator_id" text NOT NULL, "role" text DEFAULT 'carrier' NOT NULL, "asn" integer, "source_id" text, CONSTRAINT "facility_tenants_facility_id_operator_id_role_pk" PRIMARY KEY("facility_id","operator_id","role") ); --> statement-breakpoint CREATE TABLE "ixps" ( "id" text PRIMARY KEY NOT NULL, "slug" text NOT NULL, "name" text NOT NULL, "name_long" text, "city" text, "country_iso2" text, "metro_id" text, "region_continent" text, "website" text, "network_count" integer, "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "ixps_slug_unique" UNIQUE("slug") ); --> statement-breakpoint CREATE TABLE "metros" ( "id" text PRIMARY KEY NOT NULL, "slug" text NOT NULL, "name" text NOT NULL, "country_iso2" text NOT NULL, "region_name" text, "lat" double precision NOT NULL, "lng" double precision NOT NULL, "radius_km" real DEFAULT 60 NOT NULL, "aliases" text[] DEFAULT '{}'::text[] NOT NULL, "description" text, "stats" jsonb DEFAULT '{}'::jsonb NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "metros_slug_unique" UNIQUE("slug") ); --> statement-breakpoint CREATE TABLE "news_items" ( "id" text PRIMARY KEY NOT NULL, "source_id" text NOT NULL, "connector_id" text NOT NULL, "url" text NOT NULL, "title" text NOT NULL, "published_at" timestamp with time zone, "summary" text, "page_type" text DEFAULT 'unknown' NOT NULL, "event_type" text, "mentions" jsonb DEFAULT '{}'::jsonb NOT NULL, "operator_ids" text[] DEFAULT '{}'::text[] NOT NULL, "country_iso2s" text[] DEFAULT '{}'::text[] NOT NULL, "facility_ids" text[] DEFAULT '{}'::text[] NOT NULL, "project_id" text, "mw" double precision, "significance" integer DEFAULT 20 NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "news_items_url_unique" UNIQUE("url") ); --> statement-breakpoint CREATE TABLE "operators" ( "id" text PRIMARY KEY NOT NULL, "slug" text NOT NULL, "name" text NOT NULL, "normalized_name" text NOT NULL, "kind" text, "website" text, "hq_country_iso2" text, "hq_city" text, "parent_id" text, "description" text, "aliases" text[] DEFAULT '{}'::text[] NOT NULL, "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL, "is_cloud_provider" boolean DEFAULT false NOT NULL, "is_carrier" boolean DEFAULT false NOT NULL, "stats" jsonb DEFAULT '{}'::jsonb NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "operators_slug_unique" UNIQUE("slug") ); --> statement-breakpoint CREATE TABLE "project_timeline" ( "id" text PRIMARY KEY NOT NULL, "project_id" text NOT NULL, "event_date" text NOT NULL, "event_type" text NOT NULL, "description" text NOT NULL, "source_id" text, "document_id" text, "url" text, "created_at" timestamp with time zone DEFAULT now() NOT NULL ); --> statement-breakpoint CREATE TABLE "projects" ( "id" text PRIMARY KEY NOT NULL, "slug" text NOT NULL, "name" text NOT NULL, "normalized_name" text NOT NULL, "operator_id" text, "facility_id" text, "metro_id" text, "country_iso2" text, "city" text, "region_name" text, "lat" double precision, "lng" double precision, "geo_precision" text DEFAULT 'unknown' NOT NULL, "status" text DEFAULT 'announced' NOT NULL, "announced_on" text, "expected_opening" text, "planned_mw" double precision, "investment_usd" double precision, "investment_currency" text, "investment_original" double precision, "acreage" double precision, "phase_count" integer, "is_ai" boolean DEFAULT false NOT NULL, "description" text, "source_url" text, "confidence" text DEFAULT 'moderate' NOT NULL, "external_ids" jsonb DEFAULT '{}'::jsonb NOT NULL, "last_update" timestamp with time zone DEFAULT now() NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "projects_slug_unique" UNIQUE("slug") ); --> statement-breakpoint CREATE TABLE "provenance" ( "id" text PRIMARY KEY NOT NULL, "entity_type" text NOT NULL, "entity_id" text NOT NULL, "field" text NOT NULL, "value" jsonb, "source_id" text NOT NULL, "connector_id" text NOT NULL, "document_id" text, "url" text NOT NULL, "first_observed" timestamp with time zone DEFAULT now() NOT NULL, "last_observed" timestamp with time zone DEFAULT now() NOT NULL, "retrieved_at" timestamp with time zone DEFAULT now() NOT NULL, "confidence" text DEFAULT 'moderate' NOT NULL, "is_estimate" boolean DEFAULT false NOT NULL, "method" text, "extractor_version" text, "is_current" boolean DEFAULT true NOT NULL, "note" text ); --> statement-breakpoint CREATE TABLE "rankings" ( "id" text PRIMARY KEY NOT NULL, "key" text NOT NULL, "scope" text NOT NULL, "label" text NOT NULL, "unit" text NOT NULL, "methodology" text NOT NULL, "min_coverage" real, "rows" jsonb NOT NULL, "total" integer NOT NULL, "computed_at" timestamp with time zone DEFAULT now() NOT NULL, "is_current" boolean DEFAULT true NOT NULL ); --> statement-breakpoint CREATE TABLE "sources" ( "id" text PRIMARY KEY NOT NULL, "connector_id" text NOT NULL, "name" text NOT NULL, "domain" text NOT NULL, "kind" text NOT NULL, "priority" integer DEFAULT 3 NOT NULL, "url" text, "license" text, "attribution" text, "robots_allowed" boolean, "notes" text, "created_at" timestamp with time zone DEFAULT now() NOT NULL, "updated_at" timestamp with time zone DEFAULT now() NOT NULL ); --> statement-breakpoint CREATE TABLE "system_alerts" ( "id" text PRIMARY KEY NOT NULL, "level" text NOT NULL, "component" text NOT NULL, "message" text NOT NULL, "details" jsonb, "resolved_at" timestamp with time zone, "created_at" timestamp with time zone DEFAULT now() NOT NULL ); --> statement-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint ALTER 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-breakpoint CREATE UNIQUE INDEX "cloud_regions_provider_code_uq" ON "cloud_regions" USING btree ("provider_id","code");--> statement-breakpoint CREATE INDEX "cloud_regions_country_idx" ON "cloud_regions" USING btree ("country_iso2");--> statement-breakpoint CREATE INDEX "connector_runs_connector_idx" ON "connector_runs" USING btree ("connector_id","started_at");--> statement-breakpoint CREATE INDEX "document_versions_doc_idx" ON "document_versions" USING btree ("document_id","fetched_at");--> statement-breakpoint CREATE UNIQUE INDEX "documents_fingerprint_uq" ON "documents" USING btree ("url_fingerprint");--> statement-breakpoint CREATE INDEX "documents_connector_idx" ON "documents" USING btree ("connector_id");--> statement-breakpoint CREATE INDEX "documents_next_check_idx" ON "documents" USING btree ("next_check");--> statement-breakpoint CREATE INDEX "documents_page_type_idx" ON "documents" USING btree ("page_type");--> statement-breakpoint CREATE INDEX "entity_keys_entity_idx" ON "entity_keys" USING btree ("entity_type","entity_id");--> statement-breakpoint CREATE INDEX "entity_matches_status_idx" ON "entity_matches" USING btree ("status");--> statement-breakpoint CREATE INDEX "entity_matches_key_idx" ON "entity_matches" USING btree ("candidate_key");--> statement-breakpoint CREATE UNIQUE INDEX "events_fingerprint_uq" ON "events" USING btree ("fingerprint");--> statement-breakpoint CREATE INDEX "events_detected_idx" ON "events" USING btree ("detected_at");--> statement-breakpoint CREATE INDEX "events_entity_idx" ON "events" USING btree ("entity_type","entity_id");--> statement-breakpoint CREATE INDEX "events_country_idx" ON "events" USING btree ("country_iso2");--> statement-breakpoint CREATE INDEX "events_operator_idx" ON "events" USING btree ("operator_id");--> statement-breakpoint CREATE INDEX "events_type_idx" ON "events" USING btree ("event_type");--> statement-breakpoint CREATE INDEX "facilities_country_idx" ON "facilities" USING btree ("country_iso2");--> statement-breakpoint CREATE INDEX "facilities_operator_idx" ON "facilities" USING btree ("operator_id");--> statement-breakpoint CREATE INDEX "facilities_metro_idx" ON "facilities" USING btree ("metro_id");--> statement-breakpoint CREATE INDEX "facilities_status_idx" ON "facilities" USING btree ("status");--> statement-breakpoint CREATE INDEX "facilities_type_idx" ON "facilities" USING btree ("facility_type");--> statement-breakpoint CREATE INDEX "facilities_geohash_idx" ON "facilities" USING btree ("geohash");--> statement-breakpoint CREATE INDEX "facilities_norm_idx" ON "facilities" USING btree ("normalized_name");--> statement-breakpoint CREATE INDEX "facilities_updated_idx" ON "facilities" USING btree ("updated_at");--> statement-breakpoint CREATE INDEX "facility_aliases_norm_idx" ON "facility_aliases" USING btree ("normalized");--> statement-breakpoint CREATE INDEX "facility_tenants_operator_idx" ON "facility_tenants" USING btree ("operator_id");--> statement-breakpoint CREATE INDEX "metros_country_idx" ON "metros" USING btree ("country_iso2");--> statement-breakpoint CREATE INDEX "news_items_published_idx" ON "news_items" USING btree ("published_at");--> statement-breakpoint CREATE INDEX "operators_norm_idx" ON "operators" USING btree ("normalized_name");--> statement-breakpoint CREATE INDEX "operators_kind_idx" ON "operators" USING btree ("kind");--> statement-breakpoint CREATE INDEX "project_timeline_project_idx" ON "project_timeline" USING btree ("project_id");--> statement-breakpoint CREATE INDEX "projects_country_idx" ON "projects" USING btree ("country_iso2");--> statement-breakpoint CREATE INDEX "projects_operator_idx" ON "projects" USING btree ("operator_id");--> statement-breakpoint CREATE INDEX "projects_status_idx" ON "projects" USING btree ("status");--> statement-breakpoint CREATE INDEX "projects_norm_idx" ON "projects" USING btree ("normalized_name");--> statement-breakpoint CREATE INDEX "provenance_entity_idx" ON "provenance" USING btree ("entity_type","entity_id");--> statement-breakpoint CREATE INDEX "provenance_source_idx" ON "provenance" USING btree ("source_id");--> statement-breakpoint CREATE UNIQUE INDEX "provenance_uq" ON "provenance" USING btree ("entity_type","entity_id","field","source_id","url");--> statement-breakpoint CREATE INDEX "rankings_key_idx" ON "rankings" USING btree ("key","is_current");