repos
/ finance-rust master

finance-rust

mirror archived upstream

Single-binary self-hosted market watcher for stocks, ETFs, indexes, and futures: live charts, key stats, fundamentals, SEC filings, and SSE streaming.

axumdockerfinancerustself-hostedsqlitestocksvite

2.0 KB · 35 lines · MySQL Raw History
 1-- finance migration 0006: company leadership (Phase 14).
 2--
 3-- A company's officers and board, parsed from SEC Form 3/4/5 ownership XML
 4-- (each filing carries a structured reportingOwnerRelationship), plus the
 5-- 8-K item-5.02 leadership-change events surfaced from the filing history.
 6-- Stocks only: ETFs and indexes have no officers or board to track.
 7
 8-- When this stock's leadership roster was last refreshed from SEC. NULL = never.
 9ALTER TABLE symbols ADD COLUMN leadership_synced_at INTEGER;
10
11-- The 8-K item codes a filing reported, comma-separated as EDGAR's submissions
12-- feed lists them (e.g. '5.02,9.01'). Set for 8-K rows; NULL for other forms
13-- and for filing rows stored before this migration (refilled on the next SEC
14-- sync). Item 5.02 is the officer/director departure-and-appointment event,
15-- which the symbol page reads as the leadership-changes feed.
16ALTER TABLE filings ADD COLUMN items TEXT;
17
18-- One row per current insider of a company: its directors and Section-16
19-- officers, identified by the reportingOwnerRelationship booleans on their
20-- ownership filings. Filers who are only >10% beneficial owners (institutions)
21-- are not stored — they are not leadership. Upserted incrementally as new
22-- ownership filings are parsed; `last_seen` is the most recent ownership
23-- filing date observed for the person, used to order the roster and to age out
24-- insiders who have gone quiet (a rough proxy for a departure, since ownership
25-- filings carry no clean "left the company" signal).
26CREATE TABLE leadership (
27    ticker        TEXT NOT NULL REFERENCES symbols(ticker) ON DELETE CASCADE,
28    name          TEXT NOT NULL,            -- as filed: last-name-first, upper-case
29    is_director   INTEGER NOT NULL DEFAULT 0,
30    is_officer    INTEGER NOT NULL DEFAULT 0,
31    officer_title TEXT,                      -- when is_officer, e.g. 'Chief Executive Officer'
32    last_seen     TEXT NOT NULL,             -- most recent ownership filing date, YYYY-MM-DD
33    PRIMARY KEY (ticker, name)
34);