# Files changed · PR \#116 · flambo/atlantis

[View on GitCafe](https://git.cafe/flambo/atlantis/pull/116/diffs)

Repository: [flambo/atlantis](https://git.cafe/flambo/atlantis)

Visibility: public

[feat\(infra\): deploy the dashboard to Cloudflare with Alchemy](https://git.cafe/flambo/atlantis/pull/116.md)

Version: 0

Head commit: 75182f5692cbb4979c7e3b03bc8a681a6e740ad5

Base commit: b72af5856c99a520a25c9c1a604dbd39e56a4153

Comparison base: b72af5856c99a520a25c9c1a604dbd39e56a4153

Showing up to 20 entries from this revision. If the pull request changes, reopen the first page before continuing.

## \.github/workflows/ci.yaml

Status: modified; +2; −2

```diff
@@ -43,10 +43,10 @@
         run: bun run check:web
 
       - name: Lint
-        run: bun run --cwd apps/web lint
+        run: bun run --cwd apps/web lint && bun run --cwd infra lint
 
       - name: Typecheck
-        run: bun run --cwd apps/web typecheck
+        run: bun run --cwd apps/web typecheck && bun run --cwd infra typecheck
 
       - name: Test
         run: bun run test:web
```

## \.gitignore

Status: modified; +4; −0

```diff
@@ -9,6 +9,7 @@
 /result
 /apps/web/.svelte-kit
 /apps/web/build
+/apps/web/dist
 /apps/web/playwright-report
 /apps/web/test-results
 __pycache__
@@ -49,3 +50,6 @@
 /tools/netflow-db/maad_fast
 /tools/netflow-db/nfdump_reducer
 /tools/netflow-db/nfdump_reducer.build-id
+
+# Alchemy
+.alchemy
```

## \.prettierignore

Status: modified; +1; −1

```diff
@@ -4,4 +4,4 @@
 vendor/nfdump
 apps/landing/dist
 apps/landing/.astro
-apps/web/drizzle/*.sql
+apps/web/drizzle/*/migration.sql
```

## AGENTS.md

Status: modified; +1; −0

```diff
@@ -7,6 +7,7 @@
 - `tools/netflow-db`: Rust pipeline (`atlantis-netflow-db` crate) for ingestion, aggregation, verification, and analysis-window exports. Native `nfcapd` ingestion uses the pinned `nfdump` fork in `vendor/nfdump`.
 - `apps/web`: Svelte 5/SvelteKit 3 dashboard and API routes. It reads local SQLite during development and Cloudflare D1 in deployment.
 - `apps/landing`: Astro marketing and SEO site.
+- `infra`: Alchemy v2 stacks (Effect programs) that deploy the dashboard. `cloudflare.ts` deploys the worker and its D1 database; `shared.ts` holds names and paths common to all stacks.
 - `vendor/*`: Third-party analysis submodules. Treat these as read-only; build repo-local binaries through the scripts in `vendor/scripts/`.
 - `data/`, `.env`, and `datasets.json`: Machine-local inputs and generated databases. Keep paths and dataset contents out of commits.
 - `docs/user`: User setup and operation documentation.
```

## apps/web/\.prettierignore

Status: modified; +1; −1

```diff
@@ -7,4 +7,4 @@
 .svelte-kit
 build
 test-results
-drizzle/*.sql
+drizzle/*/migration.sql
```

## apps/web/drizzle/0000_military_stature.sql

Status: deleted; +0; −135

```diff
@@ -1,135 +1,0 @@
-CREATE TABLE `address_count_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_visibility` text NOT NULL,
-	`dst_visibility` text NOT NULL,
-	`address_side` text NOT NULL,
-	`unique_address_count` integer NOT NULL,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_visibility`, `dst_visibility`, `address_side`),
-	CONSTRAINT "address_count_stats_ip_version_check" CHECK("address_count_stats"."ip_version" IN (4, 6))
-);
---> statement-breakpoint
-CREATE INDEX `idx_address_count_stats_query` ON `address_count_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_visibility`,`dst_visibility`,`address_side`);--> statement-breakpoint
-CREATE TABLE `address_structure_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_visibility` text NOT NULL,
-	`dst_visibility` text NOT NULL,
-	`address_side` text NOT NULL,
-	`structure_kind` text NOT NULL,
-	`values_json` text NOT NULL,
-	`metadata_json` text NOT NULL,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_visibility`, `dst_visibility`, `address_side`, `structure_kind`),
-	CONSTRAINT "address_structure_stats_ip_version_check" CHECK("address_structure_stats"."ip_version" IN (4, 6))
-);
---> statement-breakpoint
-CREATE INDEX `idx_address_structure_stats_query` ON `address_structure_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_visibility`,`dst_visibility`,`address_side`,`structure_kind`);--> statement-breakpoint
-CREATE TABLE `datasets` (
-	`id` text PRIMARY KEY NOT NULL,
-	`label` text NOT NULL,
-	`default_start_date` text NOT NULL,
-	`source_mode` text DEFAULT 'static' NOT NULL,
-	`discovery_mode` text DEFAULT 'static' NOT NULL,
-	`sort_order` integer DEFAULT 0 NOT NULL
-);
---> statement-breakpoint
-CREATE TABLE `port_count_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_visibility` text NOT NULL,
-	`dst_visibility` text NOT NULL,
-	`port_side` text NOT NULL,
-	`port_range` text NOT NULL,
-	`unique_port_count` integer NOT NULL,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_visibility`, `dst_visibility`, `port_side`, `port_range`),
-	CONSTRAINT "port_count_stats_ip_version_check" CHECK("port_count_stats"."ip_version" IN (4, 6))
-);
---> statement-breakpoint
-CREATE INDEX `idx_port_count_stats_query` ON `port_count_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_visibility`,`dst_visibility`,`port_side`,`port_range`);--> statement-breakpoint
-CREATE TABLE `processed_inputs` (
-	`input_kind` text NOT NULL,
-	`input_locator` text NOT NULL,
-	`source_id` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`status` text DEFAULT 'pending' NOT NULL,
-	`error_message` text,
-	`discovered_at` text DEFAULT CURRENT_TIMESTAMP,
-	`processed_at` text,
-	PRIMARY KEY(`input_kind`, `input_locator`, `source_id`, `bucket_start`)
-);
---> statement-breakpoint
-CREATE INDEX `idx_processed_inputs_source_bucket` ON `processed_inputs` (`source_id`,`bucket_start`);--> statement-breakpoint
-CREATE TABLE `protocol_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_visibility` text NOT NULL,
-	`dst_visibility` text NOT NULL,
-	`unique_protocols_count` integer NOT NULL,
-	`protocols_list` text NOT NULL,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_visibility`, `dst_visibility`),
-	CONSTRAINT "protocol_stats_ip_version_check" CHECK("protocol_stats"."ip_version" IN (4, 6))
-);
---> statement-breakpoint
-CREATE INDEX `idx_protocol_stats_query` ON `protocol_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_visibility`,`dst_visibility`);--> statement-breakpoint
-CREATE TABLE `source_members` (
-	`dataset_id` text NOT NULL,
-	`source_id` text NOT NULL,
-	`member_id` text NOT NULL,
-	PRIMARY KEY(`dataset_id`, `source_id`, `member_id`)
-);
---> statement-breakpoint
-CREATE TABLE `traffic_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_visibility` text NOT NULL,
-	`dst_visibility` text NOT NULL,
-	`flows` integer NOT NULL,
-	`flows_tcp` integer NOT NULL,
-	`flows_udp` integer NOT NULL,
-	`flows_icmp` integer NOT NULL,
-	`flows_other` integer NOT NULL,
-	`packets` integer NOT NULL,
-	`packets_tcp` integer NOT NULL,
-	`packets_udp` integer NOT NULL,
-	`packets_icmp` integer NOT NULL,
-	`packets_other` integer NOT NULL,
-	`bytes` integer NOT NULL,
-	`bytes_tcp` integer NOT NULL,
-	`bytes_udp` integer NOT NULL,
-	`bytes_icmp` integer NOT NULL,
-	`bytes_other` integer NOT NULL,
-	`duration_sum_ms` integer NOT NULL,
-	`duration_count` integer NOT NULL,
-	`average_duration_ms` real,
-	`min_ttl_sum` integer NOT NULL,
-	`min_ttl_count` integer NOT NULL,
-	`average_min_ttl` real,
-	`max_ttl_sum` integer NOT NULL,
-	`max_ttl_count` integer NOT NULL,
-	`average_max_ttl` real,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_visibility`, `dst_visibility`),
-	CONSTRAINT "traffic_stats_ip_version_check" CHECK("traffic_stats"."ip_version" IN (4, 6))
-);
---> statement-breakpoint
-CREATE INDEX `idx_traffic_stats_query` ON `traffic_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_visibility`,`dst_visibility`);
```

## apps/web/drizzle/0001_capture_coverage.sql

Status: deleted; +0; −18

```diff
@@ -1,18 +1,0 @@
-CREATE TABLE `bucket_coverage` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`coverage_state` text NOT NULL,
-	`observed_units` integer NOT NULL,
-	`expected_units` integer NOT NULL,
-	`rejected_units` integer NOT NULL,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`),
-	CONSTRAINT "bucket_coverage_interval_check" CHECK("bucket_coverage"."bucket_end" > "bucket_coverage"."bucket_start"),
-	CONSTRAINT "bucket_coverage_expected_check" CHECK("bucket_coverage"."expected_units" > 0),
-	CONSTRAINT "bucket_coverage_observed_check" CHECK("bucket_coverage"."observed_units" >= 0 AND "bucket_coverage"."observed_units" <= "bucket_coverage"."expected_units"),
-	CONSTRAINT "bucket_coverage_rejected_check" CHECK("bucket_coverage"."rejected_units" >= 0 AND "bucket_coverage"."rejected_units" <= "bucket_coverage"."expected_units"),
-	CONSTRAINT "bucket_coverage_state_check" CHECK(("bucket_coverage"."coverage_state" = 'complete' AND "bucket_coverage"."observed_units" = "bucket_coverage"."expected_units" AND "bucket_coverage"."rejected_units" = 0) OR ("bucket_coverage"."coverage_state" = 'unknown' AND "bucket_coverage"."observed_units" = 0 AND "bucket_coverage"."rejected_units" = 0) OR ("bucket_coverage"."coverage_state" = 'partial' AND NOT ("bucket_coverage"."observed_units" = "bucket_coverage"."expected_units" AND "bucket_coverage"."rejected_units" = 0) AND NOT ("bucket_coverage"."observed_units" = 0 AND "bucket_coverage"."rejected_units" = 0)))
-);
---> statement-breakpoint
-CREATE INDEX `idx_bucket_coverage_query` ON `bucket_coverage` (`granularity`,`bucket_start`,`source_id`);
```

## apps/web/drizzle/0002_keen_moira_mactaggert.sql

Status: deleted; +0; −8

```diff
@@ -1,8 +1,0 @@
-DROP INDEX `idx_port_count_stats_query`;--> statement-breakpoint
-CREATE INDEX `idx_port_count_stats_timeseries` ON `port_count_stats` (`source_id`,`granularity`,`src_visibility`,`dst_visibility`,`bucket_start`);--> statement-breakpoint
-DROP INDEX `idx_protocol_stats_query`;--> statement-breakpoint
-CREATE INDEX `idx_protocol_stats_timeseries` ON `protocol_stats` (`source_id`,`granularity`,`src_visibility`,`dst_visibility`,`bucket_start`);--> statement-breakpoint
-CREATE INDEX `idx_address_count_stats_timeseries` ON `address_count_stats` (`source_id`,`granularity`,`src_visibility`,`dst_visibility`,`bucket_start`);--> statement-breakpoint
-CREATE INDEX `idx_address_structure_stats_timeseries` ON `address_structure_stats` (`source_id`,`granularity`,`src_visibility`,`dst_visibility`,`ip_version`,`structure_kind`,`bucket_start`);--> statement-breakpoint
-CREATE INDEX `idx_traffic_stats_timeseries` ON `traffic_stats` (`source_id`,`granularity`,`src_visibility`,`dst_visibility`,`bucket_start`);--> statement-breakpoint
-PRAGMA optimize;
```

## apps/web/drizzle/0003_mixed_vin_gonzales.sql

Status: deleted; +0; −135

```diff
@@ -1,135 +1,0 @@
-PRAGMA foreign_keys=OFF;--> statement-breakpoint
-CREATE TABLE `__new_address_count_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_locality` text NOT NULL,
-	`dst_locality` text NOT NULL,
-	`address_side` text NOT NULL,
-	`unique_address_count` integer NOT NULL,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`, `address_side`),
-	CONSTRAINT "address_count_stats_ip_version_check" CHECK("__new_address_count_stats"."ip_version" IN (4, 6)),
-	CONSTRAINT "address_count_stats_src_locality_check" CHECK("__new_address_count_stats"."src_locality" IN ('all', 'internal', 'external')),
-	CONSTRAINT "address_count_stats_dst_locality_check" CHECK("__new_address_count_stats"."dst_locality" IN ('all', 'internal', 'external'))
-);
---> statement-breakpoint
-INSERT INTO `__new_address_count_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "address_side", "unique_address_count", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_visibility", "dst_visibility", "address_side", "unique_address_count", "processed_at" FROM `address_count_stats` WHERE "src_visibility" = 'all' AND "dst_visibility" = 'all';--> statement-breakpoint
-DROP TABLE `address_count_stats`;--> statement-breakpoint
-ALTER TABLE `__new_address_count_stats` RENAME TO `address_count_stats`;--> statement-breakpoint
-PRAGMA foreign_keys=ON;--> statement-breakpoint
-CREATE INDEX `idx_address_count_stats_query` ON `address_count_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_locality`,`dst_locality`,`address_side`);--> statement-breakpoint
-CREATE INDEX `idx_address_count_stats_timeseries` ON `address_count_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`bucket_start`);--> statement-breakpoint
-CREATE TABLE `__new_address_structure_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_locality` text NOT NULL,
-	`dst_locality` text NOT NULL,
-	`address_side` text NOT NULL,
-	`structure_kind` text NOT NULL,
-	`values_json` text NOT NULL,
-	`metadata_json` text NOT NULL,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`, `address_side`, `structure_kind`),
-	CONSTRAINT "address_structure_stats_ip_version_check" CHECK("__new_address_structure_stats"."ip_version" IN (4, 6)),
-	CONSTRAINT "address_structure_stats_src_locality_check" CHECK("__new_address_structure_stats"."src_locality" IN ('all', 'internal', 'external')),
-	CONSTRAINT "address_structure_stats_dst_locality_check" CHECK("__new_address_structure_stats"."dst_locality" IN ('all', 'internal', 'external'))
-);
---> statement-breakpoint
-INSERT INTO `__new_address_structure_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "address_side", "structure_kind", "values_json", "metadata_json", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_visibility", "dst_visibility", "address_side", "structure_kind", "values_json", "metadata_json", "processed_at" FROM `address_structure_stats` WHERE "src_visibility" = 'all' AND "dst_visibility" = 'all';--> statement-breakpoint
-DROP TABLE `address_structure_stats`;--> statement-breakpoint
-ALTER TABLE `__new_address_structure_stats` RENAME TO `address_structure_stats`;--> statement-breakpoint
-CREATE INDEX `idx_address_structure_stats_query` ON `address_structure_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_locality`,`dst_locality`,`address_side`,`structure_kind`);--> statement-breakpoint
-CREATE INDEX `idx_address_structure_stats_timeseries` ON `address_structure_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`ip_version`,`structure_kind`,`bucket_start`);--> statement-breakpoint
-CREATE TABLE `__new_port_count_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_locality` text NOT NULL,
-	`dst_locality` text NOT NULL,
-	`port_side` text NOT NULL,
-	`port_range` text NOT NULL,
-	`unique_port_count` integer NOT NULL,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`, `port_side`, `port_range`),
-	CONSTRAINT "port_count_stats_ip_version_check" CHECK("__new_port_count_stats"."ip_version" IN (4, 6)),
-	CONSTRAINT "port_count_stats_src_locality_check" CHECK("__new_port_count_stats"."src_locality" IN ('all', 'internal', 'external')),
-	CONSTRAINT "port_count_stats_dst_locality_check" CHECK("__new_port_count_stats"."dst_locality" IN ('all', 'internal', 'external'))
-);
---> statement-breakpoint
-INSERT INTO `__new_port_count_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "port_side", "port_range", "unique_port_count", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_visibility", "dst_visibility", "port_side", "port_range", "unique_port_count", "processed_at" FROM `port_count_stats` WHERE "src_visibility" = 'all' AND "dst_visibility" = 'all';--> statement-breakpoint
-DROP TABLE `port_count_stats`;--> statement-breakpoint
-ALTER TABLE `__new_port_count_stats` RENAME TO `port_count_stats`;--> statement-breakpoint
-CREATE INDEX `idx_port_count_stats_timeseries` ON `port_count_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`bucket_start`);--> statement-breakpoint
-CREATE TABLE `__new_protocol_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_locality` text NOT NULL,
-	`dst_locality` text NOT NULL,
-	`unique_protocols_count` integer NOT NULL,
-	`protocols_list` text NOT NULL,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`),
-	CONSTRAINT "protocol_stats_ip_version_check" CHECK("__new_protocol_stats"."ip_version" IN (4, 6)),
-	CONSTRAINT "protocol_stats_src_locality_check" CHECK("__new_protocol_stats"."src_locality" IN ('all', 'internal', 'external')),
-	CONSTRAINT "protocol_stats_dst_locality_check" CHECK("__new_protocol_stats"."dst_locality" IN ('all', 'internal', 'external'))
-);
---> statement-breakpoint
-INSERT INTO `__new_protocol_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "unique_protocols_count", "protocols_list", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_visibility", "dst_visibility", "unique_protocols_count", "protocols_list", "processed_at" FROM `protocol_stats` WHERE "src_visibility" = 'all' AND "dst_visibility" = 'all';--> statement-breakpoint
-DROP TABLE `protocol_stats`;--> statement-breakpoint
-ALTER TABLE `__new_protocol_stats` RENAME TO `protocol_stats`;--> statement-breakpoint
-CREATE INDEX `idx_protocol_stats_timeseries` ON `protocol_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`bucket_start`);--> statement-breakpoint
-CREATE TABLE `__new_traffic_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_locality` text NOT NULL,
-	`dst_locality` text NOT NULL,
-	`flows` integer NOT NULL,
-	`flows_tcp` integer NOT NULL,
-	`flows_udp` integer NOT NULL,
-	`flows_icmp` integer NOT NULL,
-	`flows_other` integer NOT NULL,
-	`packets` integer NOT NULL,
-	`packets_tcp` integer NOT NULL,
-	`packets_udp` integer NOT NULL,
-	`packets_icmp` integer NOT NULL,
-	`packets_other` integer NOT NULL,
-	`bytes` integer NOT NULL,
-	`bytes_tcp` integer NOT NULL,
-	`bytes_udp` integer NOT NULL,
-	`bytes_icmp` integer NOT NULL,
-	`bytes_other` integer NOT NULL,
-	`duration_sum_ms` integer NOT NULL,
-	`duration_count` integer NOT NULL,
-	`average_duration_ms` real,
-	`min_ttl_sum` integer NOT NULL,
-	`min_ttl_count` integer NOT NULL,
-	`average_min_ttl` real,
-	`max_ttl_sum` integer NOT NULL,
-	`max_ttl_count` integer NOT NULL,
-	`average_max_ttl` real,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`),
-	CONSTRAINT "traffic_stats_ip_version_check" CHECK("__new_traffic_stats"."ip_version" IN (4, 6)),
-	CONSTRAINT "traffic_stats_src_locality_check" CHECK("__new_traffic_stats"."src_locality" IN ('all', 'internal', 'external')),
-	CONSTRAINT "traffic_stats_dst_locality_check" CHECK("__new_traffic_stats"."dst_locality" IN ('all', 'internal', 'external'))
-);
---> statement-breakpoint
-INSERT INTO `__new_traffic_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "flows", "flows_tcp", "flows_udp", "flows_icmp", "flows_other", "packets", "packets_tcp", "packets_udp", "packets_icmp", "packets_other", "bytes", "bytes_tcp", "bytes_udp", "bytes_icmp", "bytes_other", "duration_sum_ms", "duration_count", "average_duration_ms", "min_ttl_sum", "min_ttl_count", "average_min_ttl", "max_ttl_sum", "max_ttl_count", "average_max_ttl", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_visibility", "dst_visibility", "flows", "flows_tcp", "flows_udp", "flows_icmp", "flows_other", "packets", "packets_tcp", "packets_udp", "packets_icmp", "packets_other", "bytes", "bytes_tcp", "bytes_udp", "bytes_icmp", "bytes_other", "duration_sum_ms", "duration_count", "average_duration_ms", "min_ttl_sum", "min_ttl_count", "average_min_ttl", "max_ttl_sum", "max_ttl_count", "average_max_ttl", "processed_at" FROM `traffic_stats` WHERE "src_visibility" = 'all' AND "dst_visibility" = 'all';--> statement-breakpoint
-DROP TABLE `traffic_stats`;--> statement-breakpoint
-ALTER TABLE `__new_traffic_stats` RENAME TO `traffic_stats`;--> statement-breakpoint
-CREATE INDEX `idx_traffic_stats_query` ON `traffic_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_locality`,`dst_locality`);--> statement-breakpoint
-CREATE INDEX `idx_traffic_stats_timeseries` ON `traffic_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`bucket_start`);
```

## apps/web/drizzle/0004_dataset_locality.sql

Status: deleted; +0; −1

```diff
@@ -1,1 +1,0 @@
-ALTER TABLE `datasets` ADD `has_locality` integer DEFAULT false NOT NULL;
```

## apps/web/drizzle/0005_maad_measures.sql

Status: deleted; +0; −29

```diff
@@ -1,29 +1,0 @@
-PRAGMA foreign_keys=OFF;--> statement-breakpoint
-CREATE TABLE `__new_address_structure_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_locality` text NOT NULL,
-	`dst_locality` text NOT NULL,
-	`address_side` text NOT NULL,
-	`measure` text NOT NULL,
-	`structure_kind` text NOT NULL,
-	`values_json` text NOT NULL,
-	`metadata_json` text NOT NULL,
-	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
-	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`, `address_side`, `measure`, `structure_kind`),
-	CONSTRAINT "address_structure_stats_ip_version_check" CHECK("__new_address_structure_stats"."ip_version" IN (4, 6)),
-	CONSTRAINT "address_structure_stats_src_locality_check" CHECK("__new_address_structure_stats"."src_locality" IN ('all', 'internal', 'external')),
-	CONSTRAINT "address_structure_stats_dst_locality_check" CHECK("__new_address_structure_stats"."dst_locality" IN ('all', 'internal', 'external')),
-	CONSTRAINT "address_structure_stats_measure_check" CHECK("__new_address_structure_stats"."measure" IN ('addresses', 'packets', 'bytes')),
-	CONSTRAINT "address_structure_stats_measure_spectrum_check" CHECK("__new_address_structure_stats"."measure" = 'addresses' OR "__new_address_structure_stats"."structure_kind" <> 'spectrum')
-);
---> statement-breakpoint
-INSERT INTO `__new_address_structure_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "address_side", "measure", "structure_kind", "values_json", "metadata_json", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "address_side", 'addresses', "structure_kind", "values_json", "metadata_json", "processed_at" FROM `address_structure_stats`;--> statement-breakpoint
-DROP TABLE `address_structure_stats`;--> statement-breakpoint
-ALTER TABLE `__new_address_structure_stats` RENAME TO `address_structure_stats`;--> statement-breakpoint
-PRAGMA foreign_keys=ON;--> statement-breakpoint
-CREATE INDEX `idx_address_structure_stats_query` ON `address_structure_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_locality`,`dst_locality`,`address_side`,`measure`,`structure_kind`);--> statement-breakpoint
-CREATE INDEX `idx_address_structure_stats_timeseries` ON `address_structure_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`ip_version`,`measure`,`structure_kind`,`bucket_start`);
```

## apps/web/drizzle/0006_compact_maad_storage.sql

Status: deleted; +0; −48

```diff
@@ -1,48 +1,0 @@
-CREATE TABLE `address_maad_stats` (
-	`source_id` text NOT NULL,
-	`granularity` text NOT NULL,
-	`bucket_start` integer NOT NULL,
-	`bucket_end` integer NOT NULL,
-	`ip_version` integer NOT NULL,
-	`src_locality` text NOT NULL,
-	`dst_locality` text NOT NULL,
-	`address_side` text NOT NULL,
-	`measure` text NOT NULL,
-	`total_addrs` integer NOT NULL,
-	`zero_weight_addrs` integer DEFAULT 0 NOT NULL,
-	`min_prefix_length` integer,
-	`max_prefix_length` integer,
-	`d0` real,
-	`d1` real,
-	`d2` real,
-	`tau` blob,
-	`tau_sd` blob,
-	`spectrum` blob,
-	CONSTRAINT "address_maad_stats_ip_version_check" CHECK("address_maad_stats"."ip_version" IN (4, 6)),
-	CONSTRAINT "address_maad_stats_src_locality_check" CHECK("address_maad_stats"."src_locality" IN ('all', 'internal', 'external')),
-	CONSTRAINT "address_maad_stats_dst_locality_check" CHECK("address_maad_stats"."dst_locality" IN ('all', 'internal', 'external')),
-	CONSTRAINT "address_maad_stats_measure_check" CHECK("address_maad_stats"."measure" IN ('addresses', 'packets', 'bytes')),
-	CONSTRAINT "address_maad_stats_bucket_check" CHECK("address_maad_stats"."bucket_end" > "address_maad_stats"."bucket_start"),
-	CONSTRAINT "address_maad_stats_total_addrs_check" CHECK("address_maad_stats"."total_addrs" >= 0),
-	CONSTRAINT "address_maad_stats_zero_weight_addrs_check" CHECK("address_maad_stats"."zero_weight_addrs" >= 0 AND ("address_maad_stats"."measure" <> 'addresses' OR "address_maad_stats"."zero_weight_addrs" = 0)),
-	CONSTRAINT "address_maad_stats_prefix_length_check" CHECK("address_maad_stats"."max_prefix_length" >= "address_maad_stats"."min_prefix_length"),
-	CONSTRAINT "address_maad_stats_tau_check" CHECK(typeof("address_maad_stats"."tau") IN ('null', 'blob') AND length("address_maad_stats"."tau") > 0 AND length("address_maad_stats"."tau") % 4 = 0),
-	CONSTRAINT "address_maad_stats_tau_sd_check" CHECK(typeof("address_maad_stats"."tau_sd") = typeof("address_maad_stats"."tau") AND length("address_maad_stats"."tau_sd") IS length("address_maad_stats"."tau")),
-	CONSTRAINT "address_maad_stats_spectrum_check" CHECK(typeof("address_maad_stats"."spectrum") IN ('null', 'blob') AND length("address_maad_stats"."spectrum") % 8 = 0),
-	CONSTRAINT "address_maad_stats_measure_spectrum_check" CHECK("address_maad_stats"."measure" = 'addresses' OR "address_maad_stats"."spectrum" IS NULL),
-	CONSTRAINT "address_maad_stats_tau_d0_check" CHECK(("address_maad_stats"."tau" IS NULL) = ("address_maad_stats"."d0" IS NULL))
-);
---> statement-breakpoint
-CREATE UNIQUE INDEX `idx_address_maad_stats_key` ON `address_maad_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`ip_version`,`measure`,`bucket_start`,`address_side`);--> statement-breakpoint
-CREATE INDEX `idx_address_maad_stats_bucket` ON `address_maad_stats` (`granularity`,`bucket_start`);--> statement-breakpoint
-CREATE TABLE `maad_q_grid` (
-	`ip_version` integer PRIMARY KEY NOT NULL,
-	`q_min` real NOT NULL,
-	`q_step` real NOT NULL,
-	`q_count` integer NOT NULL,
-	CONSTRAINT "maad_q_grid_ip_version_check" CHECK("maad_q_grid"."ip_version" IN (4, 6)),
-	CONSTRAINT "maad_q_grid_q_step_check" CHECK("maad_q_grid"."q_step" > 0),
-	CONSTRAINT "maad_q_grid_q_count_check" CHECK("maad_q_grid"."q_count" > 0)
-);
---> statement-breakpoint
-DROP TABLE `address_structure_stats`;
```

## apps/web/drizzle/20260717171914_military_stature/migration.sql

Status: added; +135; −0

```diff
@@ -1,0 +1,135 @@
+CREATE TABLE `address_count_stats` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`ip_version` integer NOT NULL,
+	`src_visibility` text NOT NULL,
+	`dst_visibility` text NOT NULL,
+	`address_side` text NOT NULL,
+	`unique_address_count` integer NOT NULL,
+	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_visibility`, `dst_visibility`, `address_side`),
+	CONSTRAINT "address_count_stats_ip_version_check" CHECK("address_count_stats"."ip_version" IN (4, 6))
+);
+--> statement-breakpoint
+CREATE INDEX `idx_address_count_stats_query` ON `address_count_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_visibility`,`dst_visibility`,`address_side`);--> statement-breakpoint
+CREATE TABLE `address_structure_stats` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`ip_version` integer NOT NULL,
+	`src_visibility` text NOT NULL,
+	`dst_visibility` text NOT NULL,
+	`address_side` text NOT NULL,
+	`structure_kind` text NOT NULL,
+	`values_json` text NOT NULL,
+	`metadata_json` text NOT NULL,
+	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_visibility`, `dst_visibility`, `address_side`, `structure_kind`),
+	CONSTRAINT "address_structure_stats_ip_version_check" CHECK("address_structure_stats"."ip_version" IN (4, 6))
+);
+--> statement-breakpoint
+CREATE INDEX `idx_address_structure_stats_query` ON `address_structure_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_visibility`,`dst_visibility`,`address_side`,`structure_kind`);--> statement-breakpoint
+CREATE TABLE `datasets` (
+	`id` text PRIMARY KEY NOT NULL,
+	`label` text NOT NULL,
+	`default_start_date` text NOT NULL,
+	`source_mode` text DEFAULT 'static' NOT NULL,
+	`discovery_mode` text DEFAULT 'static' NOT NULL,
+	`sort_order` integer DEFAULT 0 NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE `port_count_stats` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`ip_version` integer NOT NULL,
+	`src_visibility` text NOT NULL,
+	`dst_visibility` text NOT NULL,
+	`port_side` text NOT NULL,
+	`port_range` text NOT NULL,
+	`unique_port_count` integer NOT NULL,
+	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_visibility`, `dst_visibility`, `port_side`, `port_range`),
+	CONSTRAINT "port_count_stats_ip_version_check" CHECK("port_count_stats"."ip_version" IN (4, 6))
+);
+--> statement-breakpoint
+CREATE INDEX `idx_port_count_stats_query` ON `port_count_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_visibility`,`dst_visibility`,`port_side`,`port_range`);--> statement-breakpoint
+CREATE TABLE `processed_inputs` (
+	`input_kind` text NOT NULL,
+	`input_locator` text NOT NULL,
+	`source_id` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`status` text DEFAULT 'pending' NOT NULL,
+	`error_message` text,
+	`discovered_at` text DEFAULT CURRENT_TIMESTAMP,
+	`processed_at` text,
+	PRIMARY KEY(`input_kind`, `input_locator`, `source_id`, `bucket_start`)
+);
+--> statement-breakpoint
+CREATE INDEX `idx_processed_inputs_source_bucket` ON `processed_inputs` (`source_id`,`bucket_start`);--> statement-breakpoint
+CREATE TABLE `protocol_stats` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`ip_version` integer NOT NULL,
+	`src_visibility` text NOT NULL,
+	`dst_visibility` text NOT NULL,
+	`unique_protocols_count` integer NOT NULL,
+	`protocols_list` text NOT NULL,
+	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_visibility`, `dst_visibility`),
+	CONSTRAINT "protocol_stats_ip_version_check" CHECK("protocol_stats"."ip_version" IN (4, 6))
+);
+--> statement-breakpoint
+CREATE INDEX `idx_protocol_stats_query` ON `protocol_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_visibility`,`dst_visibility`);--> statement-breakpoint
+CREATE TABLE `source_members` (
+	`dataset_id` text NOT NULL,
+	`source_id` text NOT NULL,
+	`member_id` text NOT NULL,
+	PRIMARY KEY(`dataset_id`, `source_id`, `member_id`)
+);
+--> statement-breakpoint
+CREATE TABLE `traffic_stats` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`ip_version` integer NOT NULL,
+	`src_visibility` text NOT NULL,
+	`dst_visibility` text NOT NULL,
+	`flows` integer NOT NULL,
+	`flows_tcp` integer NOT NULL,
+	`flows_udp` integer NOT NULL,
+	`flows_icmp` integer NOT NULL,
+	`flows_other` integer NOT NULL,
+	`packets` integer NOT NULL,
+	`packets_tcp` integer NOT NULL,
+	`packets_udp` integer NOT NULL,
+	`packets_icmp` integer NOT NULL,
+	`packets_other` integer NOT NULL,
+	`bytes` integer NOT NULL,
+	`bytes_tcp` integer NOT NULL,
+	`bytes_udp` integer NOT NULL,
+	`bytes_icmp` integer NOT NULL,
+	`bytes_other` integer NOT NULL,
+	`duration_sum_ms` integer NOT NULL,
+	`duration_count` integer NOT NULL,
+	`average_duration_ms` real,
+	`min_ttl_sum` integer NOT NULL,
+	`min_ttl_count` integer NOT NULL,
+	`average_min_ttl` real,
+	`max_ttl_sum` integer NOT NULL,
+	`max_ttl_count` integer NOT NULL,
+	`average_max_ttl` real,
+	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_visibility`, `dst_visibility`),
+	CONSTRAINT "traffic_stats_ip_version_check" CHECK("traffic_stats"."ip_version" IN (4, 6))
+);
+--> statement-breakpoint
+CREATE INDEX `idx_traffic_stats_query` ON `traffic_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_visibility`,`dst_visibility`);
```

## apps/web/drizzle/20260717171914_military_stature/snapshot.json

Status: added; +1305; −0

```diff
@@ -1,0 +1,1305 @@
+{
+	"dialect": "sqlite",
+	"id": "c55ac6a0-94bd-40b5-b54d-e6c40c7ddff1",
+	"prevIds": ["00000000-0000-0000-0000-000000000000"],
+	"version": "7",
+	"ddl": [
+		{
+			"name": "address_count_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "address_side",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_address_count",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility",
+				"address_side"
+			],
+			"nameExplicit": false,
+			"name": "address_count_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_address_side_pk",
+			"table": "address_count_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "address_side",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_count_stats_query",
+			"table": "address_count_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "address_count_stats_ip_version_check",
+			"table": "address_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "address_structure_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "address_side",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "structure_kind",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "values_json",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "metadata_json",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility",
+				"address_side",
+				"structure_kind"
+			],
+			"nameExplicit": false,
+			"name": "address_structure_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_address_side_structure_kind_pk",
+			"table": "address_structure_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "address_side",
+					"isExpression": false
+				},
+				{
+					"value": "structure_kind",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_structure_stats_query",
+			"table": "address_structure_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "address_structure_stats_ip_version_check",
+			"table": "address_structure_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "datasets",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "id",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["id"],
+			"nameExplicit": false,
+			"name": "datasets_pk",
+			"table": "datasets",
+			"entityType": "pks"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "label",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "default_start_date",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'static'",
+			"generated": null,
+			"name": "source_mode",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'static'",
+			"generated": null,
+			"name": "discovery_mode",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "0",
+			"generated": null,
+			"name": "sort_order",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"name": "port_count_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "port_side",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "port_range",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_port_count",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility",
+				"port_side",
+				"port_range"
+			],
+			"nameExplicit": false,
+			"name": "port_count_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_port_side_port_range_pk",
+			"table": "port_count_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "port_side",
+					"isExpression": false
+				},
+				{
+					"value": "port_range",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_port_count_stats_query",
+			"table": "port_count_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "port_count_stats_ip_version_check",
+			"table": "port_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "processed_inputs",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "input_kind",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "input_locator",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'pending'",
+			"generated": null,
+			"name": "status",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "error_message",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "discovered_at",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "processed_at",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["input_kind", "input_locator", "source_id", "bucket_start"],
+			"nameExplicit": false,
+			"name": "processed_inputs_input_kind_input_locator_source_id_bucket_start_pk",
+			"table": "processed_inputs",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_processed_inputs_source_bucket",
+			"table": "processed_inputs",
+			"entityType": "indexes"
+		},
+		{
+			"name": "protocol_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_protocols_count",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "protocols_list",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility"
+			],
+			"nameExplicit": false,
+			"name": "protocol_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_pk",
+			"table": "protocol_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_protocol_stats_query",
+			"table": "protocol_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "protocol_stats_ip_version_check",
+			"table": "protocol_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "source_members",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dataset_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "member_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["dataset_id", "source_id", "member_id"],
+			"nameExplicit": false,
+			"name": "source_members_dataset_id_source_id_member_id_pk",
+			"table": "source_members",
+			"entityType": "pks"
+		},
+		{
+			"name": "traffic_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "duration_sum_ms",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "duration_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_duration_ms",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "min_ttl_sum",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "min_ttl_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_min_ttl",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "max_ttl_sum",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "max_ttl_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_max_ttl",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility"
+			],
+			"nameExplicit": false,
+			"name": "traffic_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_pk",
+			"table": "traffic_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_traffic_stats_query",
+			"table": "traffic_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "traffic_stats_ip_version_check",
+			"table": "traffic_stats",
+			"entityType": "checks"
+		}
+	],
+	"renames": []
+}
```

## apps/web/drizzle/20260819094351_capture_coverage/migration.sql

Status: added; +18; −0

```diff
@@ -1,0 +1,18 @@
+CREATE TABLE `bucket_coverage` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`coverage_state` text NOT NULL,
+	`observed_units` integer NOT NULL,
+	`expected_units` integer NOT NULL,
+	`rejected_units` integer NOT NULL,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`),
+	CONSTRAINT "bucket_coverage_interval_check" CHECK("bucket_coverage"."bucket_end" > "bucket_coverage"."bucket_start"),
+	CONSTRAINT "bucket_coverage_expected_check" CHECK("bucket_coverage"."expected_units" > 0),
+	CONSTRAINT "bucket_coverage_observed_check" CHECK("bucket_coverage"."observed_units" >= 0 AND "bucket_coverage"."observed_units" <= "bucket_coverage"."expected_units"),
+	CONSTRAINT "bucket_coverage_rejected_check" CHECK("bucket_coverage"."rejected_units" >= 0 AND "bucket_coverage"."rejected_units" <= "bucket_coverage"."expected_units"),
+	CONSTRAINT "bucket_coverage_state_check" CHECK(("bucket_coverage"."coverage_state" = 'complete' AND "bucket_coverage"."observed_units" = "bucket_coverage"."expected_units" AND "bucket_coverage"."rejected_units" = 0) OR ("bucket_coverage"."coverage_state" = 'unknown' AND "bucket_coverage"."observed_units" = 0 AND "bucket_coverage"."rejected_units" = 0) OR ("bucket_coverage"."coverage_state" = 'partial' AND NOT ("bucket_coverage"."observed_units" = "bucket_coverage"."expected_units" AND "bucket_coverage"."rejected_units" = 0) AND NOT ("bucket_coverage"."observed_units" = 0 AND "bucket_coverage"."rejected_units" = 0)))
+);
+--> statement-breakpoint
+CREATE INDEX `idx_bucket_coverage_query` ON `bucket_coverage` (`granularity`,`bucket_start`,`source_id`);
```

## apps/web/drizzle/20260819094351_capture_coverage/snapshot.json

Status: added; +1448; −0

```diff
@@ -1,0 +1,1448 @@
+{
+	"dialect": "sqlite",
+	"id": "4884d81f-ffd7-4ac8-ad6d-6b3eadf71839",
+	"prevIds": ["c55ac6a0-94bd-40b5-b54d-e6c40c7ddff1"],
+	"version": "7",
+	"ddl": [
+		{
+			"name": "address_count_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "address_side",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_address_count",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility",
+				"address_side"
+			],
+			"nameExplicit": false,
+			"name": "address_count_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_address_side_pk",
+			"table": "address_count_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "address_side",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_count_stats_query",
+			"table": "address_count_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "address_count_stats_ip_version_check",
+			"table": "address_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "address_structure_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "address_side",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "structure_kind",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "values_json",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "metadata_json",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility",
+				"address_side",
+				"structure_kind"
+			],
+			"nameExplicit": false,
+			"name": "address_structure_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_address_side_structure_kind_pk",
+			"table": "address_structure_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "address_side",
+					"isExpression": false
+				},
+				{
+					"value": "structure_kind",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_structure_stats_query",
+			"table": "address_structure_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "address_structure_stats_ip_version_check",
+			"table": "address_structure_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "bucket_coverage",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "coverage_state",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "observed_units",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "expected_units",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "rejected_units",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["source_id", "granularity", "bucket_start"],
+			"nameExplicit": false,
+			"name": "bucket_coverage_source_id_granularity_bucket_start_pk",
+			"table": "bucket_coverage",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_bucket_coverage_query",
+			"table": "bucket_coverage",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"bucket_end\" > \"bucket_start\"",
+			"name": "bucket_coverage_interval_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"expected_units\" > 0",
+			"name": "bucket_coverage_expected_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"observed_units\" >= 0 AND \"observed_units\" <= \"expected_units\"",
+			"name": "bucket_coverage_observed_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"rejected_units\" >= 0 AND \"rejected_units\" <= \"expected_units\"",
+			"name": "bucket_coverage_rejected_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "(\"coverage_state\" = 'complete' AND \"observed_units\" = \"expected_units\" AND \"rejected_units\" = 0) OR (\"coverage_state\" = 'unknown' AND \"observed_units\" = 0 AND \"rejected_units\" = 0) OR (\"coverage_state\" = 'partial' AND NOT (\"observed_units\" = \"expected_units\" AND \"rejected_units\" = 0) AND NOT (\"observed_units\" = 0 AND \"rejected_units\" = 0))",
+			"name": "bucket_coverage_state_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"name": "datasets",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "id",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["id"],
+			"nameExplicit": false,
+			"name": "datasets_pk",
+			"table": "datasets",
+			"entityType": "pks"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "label",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "default_start_date",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'static'",
+			"generated": null,
+			"name": "source_mode",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'static'",
+			"generated": null,
+			"name": "discovery_mode",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "0",
+			"generated": null,
+			"name": "sort_order",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"name": "port_count_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "port_side",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "port_range",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_port_count",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility",
+				"port_side",
+				"port_range"
+			],
+			"nameExplicit": false,
+			"name": "port_count_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_port_side_port_range_pk",
+			"table": "port_count_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "port_side",
+					"isExpression": false
+				},
+				{
+					"value": "port_range",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_port_count_stats_query",
+			"table": "port_count_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "port_count_stats_ip_version_check",
+			"table": "port_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "processed_inputs",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "input_kind",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "input_locator",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'pending'",
+			"generated": null,
+			"name": "status",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "error_message",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "discovered_at",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "processed_at",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["input_kind", "input_locator", "source_id", "bucket_start"],
+			"nameExplicit": false,
+			"name": "processed_inputs_input_kind_input_locator_source_id_bucket_start_pk",
+			"table": "processed_inputs",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_processed_inputs_source_bucket",
+			"table": "processed_inputs",
+			"entityType": "indexes"
+		},
+		{
+			"name": "protocol_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_protocols_count",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "protocols_list",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility"
+			],
+			"nameExplicit": false,
+			"name": "protocol_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_pk",
+			"table": "protocol_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_protocol_stats_query",
+			"table": "protocol_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "protocol_stats_ip_version_check",
+			"table": "protocol_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "source_members",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dataset_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "member_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["dataset_id", "source_id", "member_id"],
+			"nameExplicit": false,
+			"name": "source_members_dataset_id_source_id_member_id_pk",
+			"table": "source_members",
+			"entityType": "pks"
+		},
+		{
+			"name": "traffic_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "duration_sum_ms",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "duration_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_duration_ms",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "min_ttl_sum",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "min_ttl_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_min_ttl",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "max_ttl_sum",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "max_ttl_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_max_ttl",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility"
+			],
+			"nameExplicit": false,
+			"name": "traffic_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_pk",
+			"table": "traffic_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_traffic_stats_query",
+			"table": "traffic_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "traffic_stats_ip_version_check",
+			"table": "traffic_stats",
+			"entityType": "checks"
+		}
+	],
+	"renames": []
+}
```

## apps/web/drizzle/20260823205054_keen_moira_mactaggert/migration.sql

Status: added; +8; −0

```diff
@@ -1,0 +1,8 @@
+DROP INDEX `idx_port_count_stats_query`;--> statement-breakpoint
+CREATE INDEX `idx_port_count_stats_timeseries` ON `port_count_stats` (`source_id`,`granularity`,`src_visibility`,`dst_visibility`,`bucket_start`);--> statement-breakpoint
+DROP INDEX `idx_protocol_stats_query`;--> statement-breakpoint
+CREATE INDEX `idx_protocol_stats_timeseries` ON `protocol_stats` (`source_id`,`granularity`,`src_visibility`,`dst_visibility`,`bucket_start`);--> statement-breakpoint
+CREATE INDEX `idx_address_count_stats_timeseries` ON `address_count_stats` (`source_id`,`granularity`,`src_visibility`,`dst_visibility`,`bucket_start`);--> statement-breakpoint
+CREATE INDEX `idx_address_structure_stats_timeseries` ON `address_structure_stats` (`source_id`,`granularity`,`src_visibility`,`dst_visibility`,`ip_version`,`structure_kind`,`bucket_start`);--> statement-breakpoint
+CREATE INDEX `idx_traffic_stats_timeseries` ON `traffic_stats` (`source_id`,`granularity`,`src_visibility`,`dst_visibility`,`bucket_start`);--> statement-breakpoint
+PRAGMA optimize;
```

## apps/web/drizzle/20260823205054_keen_moira_mactaggert/snapshot.json

Status: added; +1530; −0

```diff
@@ -1,0 +1,1530 @@
+{
+	"dialect": "sqlite",
+	"id": "0e3d6d54-fced-4c32-bac5-4eb0d8058d5e",
+	"prevIds": ["4884d81f-ffd7-4ac8-ad6d-6b3eadf71839"],
+	"version": "7",
+	"ddl": [
+		{
+			"name": "address_count_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "address_side",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_address_count",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility",
+				"address_side"
+			],
+			"nameExplicit": false,
+			"name": "address_count_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_address_side_pk",
+			"table": "address_count_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "address_side",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_count_stats_query",
+			"table": "address_count_stats",
+			"entityType": "indexes"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_count_stats_timeseries",
+			"table": "address_count_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "address_count_stats_ip_version_check",
+			"table": "address_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "address_structure_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "address_side",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "structure_kind",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "values_json",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "metadata_json",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility",
+				"address_side",
+				"structure_kind"
+			],
+			"nameExplicit": false,
+			"name": "address_structure_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_address_side_structure_kind_pk",
+			"table": "address_structure_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "address_side",
+					"isExpression": false
+				},
+				{
+					"value": "structure_kind",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_structure_stats_query",
+			"table": "address_structure_stats",
+			"entityType": "indexes"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "structure_kind",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_structure_stats_timeseries",
+			"table": "address_structure_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "address_structure_stats_ip_version_check",
+			"table": "address_structure_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "bucket_coverage",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "coverage_state",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "observed_units",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "expected_units",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "rejected_units",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["source_id", "granularity", "bucket_start"],
+			"nameExplicit": false,
+			"name": "bucket_coverage_source_id_granularity_bucket_start_pk",
+			"table": "bucket_coverage",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_bucket_coverage_query",
+			"table": "bucket_coverage",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"bucket_end\" > \"bucket_start\"",
+			"name": "bucket_coverage_interval_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"expected_units\" > 0",
+			"name": "bucket_coverage_expected_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"observed_units\" >= 0 AND \"observed_units\" <= \"expected_units\"",
+			"name": "bucket_coverage_observed_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"rejected_units\" >= 0 AND \"rejected_units\" <= \"expected_units\"",
+			"name": "bucket_coverage_rejected_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "(\"coverage_state\" = 'complete' AND \"observed_units\" = \"expected_units\" AND \"rejected_units\" = 0) OR (\"coverage_state\" = 'unknown' AND \"observed_units\" = 0 AND \"rejected_units\" = 0) OR (\"coverage_state\" = 'partial' AND NOT (\"observed_units\" = \"expected_units\" AND \"rejected_units\" = 0) AND NOT (\"observed_units\" = 0 AND \"rejected_units\" = 0))",
+			"name": "bucket_coverage_state_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"name": "datasets",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "id",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["id"],
+			"nameExplicit": false,
+			"name": "datasets_pk",
+			"table": "datasets",
+			"entityType": "pks"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "label",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "default_start_date",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'static'",
+			"generated": null,
+			"name": "source_mode",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'static'",
+			"generated": null,
+			"name": "discovery_mode",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "0",
+			"generated": null,
+			"name": "sort_order",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"name": "port_count_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "port_side",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "port_range",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_port_count",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility",
+				"port_side",
+				"port_range"
+			],
+			"nameExplicit": false,
+			"name": "port_count_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_port_side_port_range_pk",
+			"table": "port_count_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_port_count_stats_timeseries",
+			"table": "port_count_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "port_count_stats_ip_version_check",
+			"table": "port_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "processed_inputs",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "input_kind",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "input_locator",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'pending'",
+			"generated": null,
+			"name": "status",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "error_message",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "discovered_at",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "processed_at",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["input_kind", "input_locator", "source_id", "bucket_start"],
+			"nameExplicit": false,
+			"name": "processed_inputs_input_kind_input_locator_source_id_bucket_start_pk",
+			"table": "processed_inputs",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_processed_inputs_source_bucket",
+			"table": "processed_inputs",
+			"entityType": "indexes"
+		},
+		{
+			"name": "protocol_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_protocols_count",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "protocols_list",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility"
+			],
+			"nameExplicit": false,
+			"name": "protocol_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_pk",
+			"table": "protocol_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_protocol_stats_timeseries",
+			"table": "protocol_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "protocol_stats_ip_version_check",
+			"table": "protocol_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "source_members",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dataset_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "member_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["dataset_id", "source_id", "member_id"],
+			"nameExplicit": false,
+			"name": "source_members_dataset_id_source_id_member_id_pk",
+			"table": "source_members",
+			"entityType": "pks"
+		},
+		{
+			"name": "traffic_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_visibility",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_visibility",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "duration_sum_ms",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "duration_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_duration_ms",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "min_ttl_sum",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "min_ttl_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_min_ttl",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "max_ttl_sum",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "max_ttl_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_max_ttl",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_visibility",
+				"dst_visibility"
+			],
+			"nameExplicit": false,
+			"name": "traffic_stats_source_id_granularity_bucket_start_ip_version_src_visibility_dst_visibility_pk",
+			"table": "traffic_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_traffic_stats_query",
+			"table": "traffic_stats",
+			"entityType": "indexes"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "src_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "dst_visibility",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_traffic_stats_timeseries",
+			"table": "traffic_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "traffic_stats_ip_version_check",
+			"table": "traffic_stats",
+			"entityType": "checks"
+		}
+	],
+	"renames": []
+}
```

## apps/web/drizzle/20260924084337_mixed_vin_gonzales/migration.sql

Status: added; +135; −0

```diff
@@ -1,0 +1,135 @@
+PRAGMA foreign_keys=OFF;--> statement-breakpoint
+CREATE TABLE `__new_address_count_stats` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`ip_version` integer NOT NULL,
+	`src_locality` text NOT NULL,
+	`dst_locality` text NOT NULL,
+	`address_side` text NOT NULL,
+	`unique_address_count` integer NOT NULL,
+	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`, `address_side`),
+	CONSTRAINT "address_count_stats_ip_version_check" CHECK("__new_address_count_stats"."ip_version" IN (4, 6)),
+	CONSTRAINT "address_count_stats_src_locality_check" CHECK("__new_address_count_stats"."src_locality" IN ('all', 'internal', 'external')),
+	CONSTRAINT "address_count_stats_dst_locality_check" CHECK("__new_address_count_stats"."dst_locality" IN ('all', 'internal', 'external'))
+);
+--> statement-breakpoint
+INSERT INTO `__new_address_count_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "address_side", "unique_address_count", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_visibility", "dst_visibility", "address_side", "unique_address_count", "processed_at" FROM `address_count_stats` WHERE "src_visibility" = 'all' AND "dst_visibility" = 'all';--> statement-breakpoint
+DROP TABLE `address_count_stats`;--> statement-breakpoint
+ALTER TABLE `__new_address_count_stats` RENAME TO `address_count_stats`;--> statement-breakpoint
+PRAGMA foreign_keys=ON;--> statement-breakpoint
+CREATE INDEX `idx_address_count_stats_query` ON `address_count_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_locality`,`dst_locality`,`address_side`);--> statement-breakpoint
+CREATE INDEX `idx_address_count_stats_timeseries` ON `address_count_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`bucket_start`);--> statement-breakpoint
+CREATE TABLE `__new_address_structure_stats` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`ip_version` integer NOT NULL,
+	`src_locality` text NOT NULL,
+	`dst_locality` text NOT NULL,
+	`address_side` text NOT NULL,
+	`structure_kind` text NOT NULL,
+	`values_json` text NOT NULL,
+	`metadata_json` text NOT NULL,
+	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`, `address_side`, `structure_kind`),
+	CONSTRAINT "address_structure_stats_ip_version_check" CHECK("__new_address_structure_stats"."ip_version" IN (4, 6)),
+	CONSTRAINT "address_structure_stats_src_locality_check" CHECK("__new_address_structure_stats"."src_locality" IN ('all', 'internal', 'external')),
+	CONSTRAINT "address_structure_stats_dst_locality_check" CHECK("__new_address_structure_stats"."dst_locality" IN ('all', 'internal', 'external'))
+);
+--> statement-breakpoint
+INSERT INTO `__new_address_structure_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "address_side", "structure_kind", "values_json", "metadata_json", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_visibility", "dst_visibility", "address_side", "structure_kind", "values_json", "metadata_json", "processed_at" FROM `address_structure_stats` WHERE "src_visibility" = 'all' AND "dst_visibility" = 'all';--> statement-breakpoint
+DROP TABLE `address_structure_stats`;--> statement-breakpoint
+ALTER TABLE `__new_address_structure_stats` RENAME TO `address_structure_stats`;--> statement-breakpoint
+CREATE INDEX `idx_address_structure_stats_query` ON `address_structure_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_locality`,`dst_locality`,`address_side`,`structure_kind`);--> statement-breakpoint
+CREATE INDEX `idx_address_structure_stats_timeseries` ON `address_structure_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`ip_version`,`structure_kind`,`bucket_start`);--> statement-breakpoint
+CREATE TABLE `__new_port_count_stats` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`ip_version` integer NOT NULL,
+	`src_locality` text NOT NULL,
+	`dst_locality` text NOT NULL,
+	`port_side` text NOT NULL,
+	`port_range` text NOT NULL,
+	`unique_port_count` integer NOT NULL,
+	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`, `port_side`, `port_range`),
+	CONSTRAINT "port_count_stats_ip_version_check" CHECK("__new_port_count_stats"."ip_version" IN (4, 6)),
+	CONSTRAINT "port_count_stats_src_locality_check" CHECK("__new_port_count_stats"."src_locality" IN ('all', 'internal', 'external')),
+	CONSTRAINT "port_count_stats_dst_locality_check" CHECK("__new_port_count_stats"."dst_locality" IN ('all', 'internal', 'external'))
+);
+--> statement-breakpoint
+INSERT INTO `__new_port_count_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "port_side", "port_range", "unique_port_count", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_visibility", "dst_visibility", "port_side", "port_range", "unique_port_count", "processed_at" FROM `port_count_stats` WHERE "src_visibility" = 'all' AND "dst_visibility" = 'all';--> statement-breakpoint
+DROP TABLE `port_count_stats`;--> statement-breakpoint
+ALTER TABLE `__new_port_count_stats` RENAME TO `port_count_stats`;--> statement-breakpoint
+CREATE INDEX `idx_port_count_stats_timeseries` ON `port_count_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`bucket_start`);--> statement-breakpoint
+CREATE TABLE `__new_protocol_stats` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`ip_version` integer NOT NULL,
+	`src_locality` text NOT NULL,
+	`dst_locality` text NOT NULL,
+	`unique_protocols_count` integer NOT NULL,
+	`protocols_list` text NOT NULL,
+	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`),
+	CONSTRAINT "protocol_stats_ip_version_check" CHECK("__new_protocol_stats"."ip_version" IN (4, 6)),
+	CONSTRAINT "protocol_stats_src_locality_check" CHECK("__new_protocol_stats"."src_locality" IN ('all', 'internal', 'external')),
+	CONSTRAINT "protocol_stats_dst_locality_check" CHECK("__new_protocol_stats"."dst_locality" IN ('all', 'internal', 'external'))
+);
+--> statement-breakpoint
+INSERT INTO `__new_protocol_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "unique_protocols_count", "protocols_list", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_visibility", "dst_visibility", "unique_protocols_count", "protocols_list", "processed_at" FROM `protocol_stats` WHERE "src_visibility" = 'all' AND "dst_visibility" = 'all';--> statement-breakpoint
+DROP TABLE `protocol_stats`;--> statement-breakpoint
+ALTER TABLE `__new_protocol_stats` RENAME TO `protocol_stats`;--> statement-breakpoint
+CREATE INDEX `idx_protocol_stats_timeseries` ON `protocol_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`bucket_start`);--> statement-breakpoint
+CREATE TABLE `__new_traffic_stats` (
+	`source_id` text NOT NULL,
+	`granularity` text NOT NULL,
+	`bucket_start` integer NOT NULL,
+	`bucket_end` integer NOT NULL,
+	`ip_version` integer NOT NULL,
+	`src_locality` text NOT NULL,
+	`dst_locality` text NOT NULL,
+	`flows` integer NOT NULL,
+	`flows_tcp` integer NOT NULL,
+	`flows_udp` integer NOT NULL,
+	`flows_icmp` integer NOT NULL,
+	`flows_other` integer NOT NULL,
+	`packets` integer NOT NULL,
+	`packets_tcp` integer NOT NULL,
+	`packets_udp` integer NOT NULL,
+	`packets_icmp` integer NOT NULL,
+	`packets_other` integer NOT NULL,
+	`bytes` integer NOT NULL,
+	`bytes_tcp` integer NOT NULL,
+	`bytes_udp` integer NOT NULL,
+	`bytes_icmp` integer NOT NULL,
+	`bytes_other` integer NOT NULL,
+	`duration_sum_ms` integer NOT NULL,
+	`duration_count` integer NOT NULL,
+	`average_duration_ms` real,
+	`min_ttl_sum` integer NOT NULL,
+	`min_ttl_count` integer NOT NULL,
+	`average_min_ttl` real,
+	`max_ttl_sum` integer NOT NULL,
+	`max_ttl_count` integer NOT NULL,
+	`average_max_ttl` real,
+	`processed_at` text DEFAULT CURRENT_TIMESTAMP,
+	PRIMARY KEY(`source_id`, `granularity`, `bucket_start`, `ip_version`, `src_locality`, `dst_locality`),
+	CONSTRAINT "traffic_stats_ip_version_check" CHECK("__new_traffic_stats"."ip_version" IN (4, 6)),
+	CONSTRAINT "traffic_stats_src_locality_check" CHECK("__new_traffic_stats"."src_locality" IN ('all', 'internal', 'external')),
+	CONSTRAINT "traffic_stats_dst_locality_check" CHECK("__new_traffic_stats"."dst_locality" IN ('all', 'internal', 'external'))
+);
+--> statement-breakpoint
+INSERT INTO `__new_traffic_stats`("source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_locality", "dst_locality", "flows", "flows_tcp", "flows_udp", "flows_icmp", "flows_other", "packets", "packets_tcp", "packets_udp", "packets_icmp", "packets_other", "bytes", "bytes_tcp", "bytes_udp", "bytes_icmp", "bytes_other", "duration_sum_ms", "duration_count", "average_duration_ms", "min_ttl_sum", "min_ttl_count", "average_min_ttl", "max_ttl_sum", "max_ttl_count", "average_max_ttl", "processed_at") SELECT "source_id", "granularity", "bucket_start", "bucket_end", "ip_version", "src_visibility", "dst_visibility", "flows", "flows_tcp", "flows_udp", "flows_icmp", "flows_other", "packets", "packets_tcp", "packets_udp", "packets_icmp", "packets_other", "bytes", "bytes_tcp", "bytes_udp", "bytes_icmp", "bytes_other", "duration_sum_ms", "duration_count", "average_duration_ms", "min_ttl_sum", "min_ttl_count", "average_min_ttl", "max_ttl_sum", "max_ttl_count", "average_max_ttl", "processed_at" FROM `traffic_stats` WHERE "src_visibility" = 'all' AND "dst_visibility" = 'all';--> statement-breakpoint
+DROP TABLE `traffic_stats`;--> statement-breakpoint
+ALTER TABLE `__new_traffic_stats` RENAME TO `traffic_stats`;--> statement-breakpoint
+CREATE INDEX `idx_traffic_stats_query` ON `traffic_stats` (`granularity`,`bucket_start`,`source_id`,`ip_version`,`src_locality`,`dst_locality`);--> statement-breakpoint
+CREATE INDEX `idx_traffic_stats_timeseries` ON `traffic_stats` (`source_id`,`granularity`,`src_locality`,`dst_locality`,`bucket_start`);
```

## apps/web/drizzle/20260924084337_mixed_vin_gonzales/snapshot.json

Status: added; +1601; −0

```diff
@@ -1,0 +1,1601 @@
+{
+	"dialect": "sqlite",
+	"id": "fd8995ec-c2ce-4783-b511-a365deea8f51",
+	"prevIds": ["0e3d6d54-fced-4c32-bac5-4eb0d8058d5e"],
+	"version": "7",
+	"ddl": [
+		{
+			"name": "address_count_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_locality",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_locality",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "address_side",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_address_count",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "address_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_locality",
+				"dst_locality",
+				"address_side"
+			],
+			"nameExplicit": false,
+			"name": "address_count_stats_source_id_granularity_bucket_start_ip_version_src_locality_dst_locality_address_side_pk",
+			"table": "address_count_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_locality",
+					"isExpression": false
+				},
+				{
+					"value": "dst_locality",
+					"isExpression": false
+				},
+				{
+					"value": "address_side",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_count_stats_query",
+			"table": "address_count_stats",
+			"entityType": "indexes"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "src_locality",
+					"isExpression": false
+				},
+				{
+					"value": "dst_locality",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_count_stats_timeseries",
+			"table": "address_count_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "address_count_stats_ip_version_check",
+			"table": "address_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"src_locality\" IN ('all', 'internal', 'external')",
+			"name": "address_count_stats_src_locality_check",
+			"table": "address_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"dst_locality\" IN ('all', 'internal', 'external')",
+			"name": "address_count_stats_dst_locality_check",
+			"table": "address_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "address_structure_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_locality",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_locality",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "address_side",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "structure_kind",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "values_json",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "metadata_json",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "address_structure_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_locality",
+				"dst_locality",
+				"address_side",
+				"structure_kind"
+			],
+			"nameExplicit": false,
+			"name": "address_structure_stats_source_id_granularity_bucket_start_ip_version_src_locality_dst_locality_address_side_structure_kind_pk",
+			"table": "address_structure_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_locality",
+					"isExpression": false
+				},
+				{
+					"value": "dst_locality",
+					"isExpression": false
+				},
+				{
+					"value": "address_side",
+					"isExpression": false
+				},
+				{
+					"value": "structure_kind",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_structure_stats_query",
+			"table": "address_structure_stats",
+			"entityType": "indexes"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "src_locality",
+					"isExpression": false
+				},
+				{
+					"value": "dst_locality",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "structure_kind",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_address_structure_stats_timeseries",
+			"table": "address_structure_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "address_structure_stats_ip_version_check",
+			"table": "address_structure_stats",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"src_locality\" IN ('all', 'internal', 'external')",
+			"name": "address_structure_stats_src_locality_check",
+			"table": "address_structure_stats",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"dst_locality\" IN ('all', 'internal', 'external')",
+			"name": "address_structure_stats_dst_locality_check",
+			"table": "address_structure_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "bucket_coverage",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "coverage_state",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "observed_units",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "expected_units",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "rejected_units",
+			"table": "bucket_coverage",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["source_id", "granularity", "bucket_start"],
+			"nameExplicit": false,
+			"name": "bucket_coverage_source_id_granularity_bucket_start_pk",
+			"table": "bucket_coverage",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_bucket_coverage_query",
+			"table": "bucket_coverage",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"bucket_end\" > \"bucket_start\"",
+			"name": "bucket_coverage_interval_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"expected_units\" > 0",
+			"name": "bucket_coverage_expected_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"observed_units\" >= 0 AND \"observed_units\" <= \"expected_units\"",
+			"name": "bucket_coverage_observed_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"rejected_units\" >= 0 AND \"rejected_units\" <= \"expected_units\"",
+			"name": "bucket_coverage_rejected_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"value": "(\"coverage_state\" = 'complete' AND \"observed_units\" = \"expected_units\" AND \"rejected_units\" = 0) OR (\"coverage_state\" = 'unknown' AND \"observed_units\" = 0 AND \"rejected_units\" = 0) OR (\"coverage_state\" = 'partial' AND NOT (\"observed_units\" = \"expected_units\" AND \"rejected_units\" = 0) AND NOT (\"observed_units\" = 0 AND \"rejected_units\" = 0))",
+			"name": "bucket_coverage_state_check",
+			"table": "bucket_coverage",
+			"entityType": "checks"
+		},
+		{
+			"name": "datasets",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "id",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["id"],
+			"nameExplicit": false,
+			"name": "datasets_pk",
+			"table": "datasets",
+			"entityType": "pks"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "label",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "default_start_date",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'static'",
+			"generated": null,
+			"name": "source_mode",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'static'",
+			"generated": null,
+			"name": "discovery_mode",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "0",
+			"generated": null,
+			"name": "sort_order",
+			"table": "datasets",
+			"entityType": "columns"
+		},
+		{
+			"name": "port_count_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_locality",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_locality",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "port_side",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "port_range",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_port_count",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "port_count_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_locality",
+				"dst_locality",
+				"port_side",
+				"port_range"
+			],
+			"nameExplicit": false,
+			"name": "port_count_stats_source_id_granularity_bucket_start_ip_version_src_locality_dst_locality_port_side_port_range_pk",
+			"table": "port_count_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "src_locality",
+					"isExpression": false
+				},
+				{
+					"value": "dst_locality",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_port_count_stats_timeseries",
+			"table": "port_count_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "port_count_stats_ip_version_check",
+			"table": "port_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"src_locality\" IN ('all', 'internal', 'external')",
+			"name": "port_count_stats_src_locality_check",
+			"table": "port_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"dst_locality\" IN ('all', 'internal', 'external')",
+			"name": "port_count_stats_dst_locality_check",
+			"table": "port_count_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "processed_inputs",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "input_kind",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "input_locator",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": "'pending'",
+			"generated": null,
+			"name": "status",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "error_message",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "discovered_at",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "processed_at",
+			"table": "processed_inputs",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["input_kind", "input_locator", "source_id", "bucket_start"],
+			"nameExplicit": false,
+			"name": "processed_inputs_input_kind_input_locator_source_id_bucket_start_pk",
+			"table": "processed_inputs",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_processed_inputs_source_bucket",
+			"table": "processed_inputs",
+			"entityType": "indexes"
+		},
+		{
+			"name": "protocol_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_locality",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_locality",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "unique_protocols_count",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "protocols_list",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "protocol_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_locality",
+				"dst_locality"
+			],
+			"nameExplicit": false,
+			"name": "protocol_stats_source_id_granularity_bucket_start_ip_version_src_locality_dst_locality_pk",
+			"table": "protocol_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "src_locality",
+					"isExpression": false
+				},
+				{
+					"value": "dst_locality",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_protocol_stats_timeseries",
+			"table": "protocol_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "protocol_stats_ip_version_check",
+			"table": "protocol_stats",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"src_locality\" IN ('all', 'internal', 'external')",
+			"name": "protocol_stats_src_locality_check",
+			"table": "protocol_stats",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"dst_locality\" IN ('all', 'internal', 'external')",
+			"name": "protocol_stats_dst_locality_check",
+			"table": "protocol_stats",
+			"entityType": "checks"
+		},
+		{
+			"name": "source_members",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dataset_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "member_id",
+			"table": "source_members",
+			"entityType": "columns"
+		},
+		{
+			"columns": ["dataset_id", "source_id", "member_id"],
+			"nameExplicit": false,
+			"name": "source_members_dataset_id_source_id_member_id_pk",
+			"table": "source_members",
+			"entityType": "pks"
+		},
+		{
+			"name": "traffic_stats",
+			"entityType": "tables"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "source_id",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "granularity",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_start",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bucket_end",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "ip_version",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "src_locality",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "dst_locality",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "flows_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "packets_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_tcp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_udp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_icmp",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "bytes_other",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "duration_sum_ms",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "duration_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_duration_ms",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "min_ttl_sum",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "min_ttl_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_min_ttl",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "max_ttl_sum",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "integer",
+			"notNull": true,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "max_ttl_count",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "real",
+			"notNull": false,
+			"autoincrement": false,
+			"default": null,
+			"generated": null,
+			"name": "average_max_ttl",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"type": "text",
+			"notNull": false,
+			"autoincrement": false,
+			"default": "CURRENT_TIMESTAMP",
+			"generated": null,
+			"name": "processed_at",
+			"table": "traffic_stats",
+			"entityType": "columns"
+		},
+		{
+			"columns": [
+				"source_id",
+				"granularity",
+				"bucket_start",
+				"ip_version",
+				"src_locality",
+				"dst_locality"
+			],
+			"nameExplicit": false,
+			"name": "traffic_stats_source_id_granularity_bucket_start_ip_version_src_locality_dst_locality_pk",
+			"table": "traffic_stats",
+			"entityType": "pks"
+		},
+		{
+			"columns": [
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				},
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "ip_version",
+					"isExpression": false
+				},
+				{
+					"value": "src_locality",
+					"isExpression": false
+				},
+				{
+					"value": "dst_locality",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_traffic_stats_query",
+			"table": "traffic_stats",
+			"entityType": "indexes"
+		},
+		{
+			"columns": [
+				{
+					"value": "source_id",
+					"isExpression": false
+				},
+				{
+					"value": "granularity",
+					"isExpression": false
+				},
+				{
+					"value": "src_locality",
+					"isExpression": false
+				},
+				{
+					"value": "dst_locality",
+					"isExpression": false
+				},
+				{
+					"value": "bucket_start",
+					"isExpression": false
+				}
+			],
+			"isUnique": false,
+			"where": null,
+			"origin": "manual",
+			"name": "idx_traffic_stats_timeseries",
+			"table": "traffic_stats",
+			"entityType": "indexes"
+		},
+		{
+			"value": "\"ip_version\" IN (4, 6)",
+			"name": "traffic_stats_ip_version_check",
+			"table": "traffic_stats",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"src_locality\" IN ('all', 'internal', 'external')",
+			"name": "traffic_stats_src_locality_check",
+			"table": "traffic_stats",
+			"entityType": "checks"
+		},
+		{
+			"value": "\"dst_locality\" IN ('all', 'internal', 'external')",
+			"name": "traffic_stats_dst_locality_check",
+			"table": "traffic_stats",
+			"entityType": "checks"
+		}
+	],
+	"renames": [
+		"\"address_count_stats\".\"src_visibility\"->\"address_count_stats\".\"src_locality\"",
+		"\"address_count_stats\".\"dst_visibility\"->\"address_count_stats\".\"dst_locality\"",
+		"\"address_structure_stats\".\"src_visibility\"->\"address_structure_stats\".\"src_locality\"",
+		"\"address_structure_stats\".\"dst_visibility\"->\"address_structure_stats\".\"dst_locality\"",
+		"\"port_count_stats\".\"src_visibility\"->\"port_count_stats\".\"src_locality\"",
+		"\"port_count_stats\".\"dst_visibility\"->\"port_count_stats\".\"dst_locality\"",
+		"\"protocol_stats\".\"src_visibility\"->\"protocol_stats\".\"src_locality\"",
+		"\"protocol_stats\".\"dst_visibility\"->\"protocol_stats\".\"dst_locality\"",
+		"\"traffic_stats\".\"src_visibility\"->\"traffic_stats\".\"src_locality\"",
+		"\"traffic_stats\".\"dst_visibility\"->\"traffic_stats\".\"dst_locality\""
+	]
+}
```

[Next page](https://git.cafe/flambo/atlantis/pull/116/diffs?after=ImFwcHMvd2ViL2RyaXp6bGUvMjAyNjA5MjQwODQzMzdfbWl4ZWRfdmluX2dvbnphbGVzL3NuYXBzaG90Lmpzb24i&expectedVersion=0&format=markdown)
