Перейти к содержанию

ER diagram — legacy context (radar.*)🔗

Generated from the live PostgreSQL schema (schema radar) by tbls, then compacted to keys + foreign keys for legibility. Do not hand-edit the fenced block. This is the Reference layer — it reflects the real database, not the ORM.

The 13 legacy tables of the original Telegram/VK ingestion pipeline. candidates and fetch_runs are the spine shared with the SocialScan context (see socialscan.md and context-bridge.md). Only primary keys (PK) and foreign keys (FK) are shown; edge labels are the FK column.

erDiagram

"radar.article_hashtags" {
  bigint article_id FK
}
"radar.article_mentions" {
  bigint article_id FK
}
"radar.article_metrics_snapshots" {
  bigint article_id FK
  bigint fetch_run_id FK
  bigint id PK
}
"radar.article_restrictions" {
  bigint article_id FK
  bigint id PK
}
"radar.article_revisions" {
  bigint article_id FK
  bigint fetch_run_id FK
  bigint id PK
}
"radar.articles" {
  bigint candidate_id FK
  bigint id PK
}
"radar.candidates" {
  bigint id PK
}
"radar.channel_snapshots" {
  bigint candidate_id FK
  bigint fetch_run_id FK
  bigint id PK
}
"radar.comment_authors" {
  bigint id PK
}
"radar.comments" {
  bigint article_id FK
  bigint fetch_run_id FK
  bigint id PK
}
"radar.fetch_runs" {
  bigint candidate_id FK
  bigint id PK
}
"radar.forwards" {
  bigint article_id FK
  bigint id PK
}
"radar.reaction_snapshots" {
  bigint article_id FK
  bigint fetch_run_id FK
  bigint id PK
}

"radar.article_hashtags" }o--|| "radar.articles" : article_id
"radar.article_mentions" }o--|| "radar.articles" : article_id
"radar.article_metrics_snapshots" }o--o| "radar.fetch_runs" : fetch_run_id
"radar.article_metrics_snapshots" }o--|| "radar.articles" : article_id
"radar.article_restrictions" }o--|| "radar.articles" : article_id
"radar.article_revisions" }o--o| "radar.fetch_runs" : fetch_run_id
"radar.article_revisions" }o--|| "radar.articles" : article_id
"radar.articles" }o--|| "radar.candidates" : candidate_id
"radar.channel_snapshots" }o--o| "radar.fetch_runs" : fetch_run_id
"radar.channel_snapshots" }o--|| "radar.candidates" : candidate_id
"radar.comments" }o--o| "radar.fetch_runs" : fetch_run_id
"radar.comments" }o--|| "radar.articles" : article_id
"radar.fetch_runs" }o--o| "radar.candidates" : candidate_id
"radar.forwards" }o--|| "radar.articles" : article_id
"radar.reaction_snapshots" }o--o| "radar.fetch_runs" : fetch_run_id
"radar.reaction_snapshots" }o--|| "radar.articles" : article_id

Spine. candidates (the political actor) and fetch_runs (one ingestion run) anchor every other legacy table and reach across into SocialScan.


Regenerate: tbls out "$DSN" -t mermaid --include <table-list> | python3 ../tools/compact_erd.py /dev/stdin. Boundary spine tables candidates/fetch_runs appear in both context diagrams by design; cross-context edges live in context-bridge.md. Drift gate: tbls diff against the live schema.