feat(dolt): add shares_outstanding_date to fundamental_snapshots (026)

A1 carry-forward. The SEC cover-page share count
(dei:EntityCommonStockSharesOutstanding) is reported "as of" its own date, which
can differ from the fiscal period_end — store that date so market cap uses the
right point-in-time count. Migration 026 edited in place (never run with data).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-22 11:50:38 +02:00
co-authored by Claude Opus 4.8
parent 54ae8ba153
commit a4e33d7a39
2 changed files with 5 additions and 0 deletions
@@ -66,6 +66,7 @@ def upgrade() -> None:
sa.Column("cash_and_st_investments", sa.Float(), nullable=True), sa.Column("cash_and_st_investments", sa.Float(), nullable=True),
sa.Column("total_debt", sa.Float(), nullable=True), sa.Column("total_debt", sa.Float(), nullable=True),
sa.Column("shares_outstanding", sa.Float(), nullable=True), sa.Column("shares_outstanding", sa.Float(), nullable=True),
sa.Column("shares_outstanding_date", sa.Date(), nullable=True),
sa.Column( sa.Column(
"import_run_id", "import_run_id",
sa.Integer(), sa.Integer(),
+4
View File
@@ -64,6 +64,10 @@ class FundamentalSnapshot(Base):
cash_and_st_investments: Mapped[float | None] = mapped_column(Float, nullable=True) cash_and_st_investments: Mapped[float | None] = mapped_column(Float, nullable=True)
total_debt: Mapped[float | None] = mapped_column(Float, nullable=True) total_debt: Mapped[float | None] = mapped_column(Float, nullable=True)
shares_outstanding: Mapped[float | None] = mapped_column(Float, nullable=True) shares_outstanding: Mapped[float | None] = mapped_column(Float, nullable=True)
# The cover-page share count (dei:EntityCommonStockSharesOutstanding) is
# reported "as of" its own date, which can differ from period_end — store it
# so market cap uses the right point-in-time count.
shares_outstanding_date: Mapped[date | None] = mapped_column(Date, nullable=True)
import_run_id: Mapped[int | None] = mapped_column( import_run_id: Mapped[int | None] = mapped_column(
ForeignKey("data_import_runs.id", ondelete="SET NULL"), nullable=True ForeignKey("data_import_runs.id", ondelete="SET NULL"), nullable=True