feat(financials-v2): add statement snapshot schema and shared types
This commit is contained in:
22
drizzle/0001_glossy_statement_snapshots.sql
Normal file
22
drizzle/0001_glossy_statement_snapshots.sql
Normal 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`);
|
||||
Reference in New Issue
Block a user