feat(financials-v2): add statement snapshot schema and shared types

This commit is contained in:
2026-03-02 09:33:44 -05:00
parent f34c4bbcee
commit bcf4c69c92
4 changed files with 183 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
CREATE TABLE `filing_statement_snapshot` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`filing_id` integer NOT NULL,
`ticker` text NOT NULL,
`filing_date` text NOT NULL,
`filing_type` text NOT NULL,
`period_end` text,
`statement_bundle` text,
`standardized_bundle` text,
`dimension_bundle` text,
`parse_status` text NOT NULL,
`parse_error` text,
`source` text NOT NULL,
`created_at` text NOT NULL,
`updated_at` text NOT NULL,
FOREIGN KEY (`filing_id`) REFERENCES `filing`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `filing_stmt_filing_uidx` ON `filing_statement_snapshot` (`filing_id`);--> statement-breakpoint
CREATE INDEX `filing_stmt_ticker_date_idx` ON `filing_statement_snapshot` (`ticker`,`filing_date`);--> statement-breakpoint
CREATE INDEX `filing_stmt_date_idx` ON `filing_statement_snapshot` (`filing_date`);--> statement-breakpoint
CREATE INDEX `filing_stmt_status_idx` ON `filing_statement_snapshot` (`parse_status`);

View File

@@ -8,6 +8,13 @@
"when": 1772137733427,
"tag": "0000_cold_silver_centurion",
"breakpoints": true
},
{
"idx": 1,
"version": "6",
"when": 1772417400000,
"tag": "0001_glossy_statement_snapshots",
"breakpoints": true
}
]
}
}