Implement fiscal-style research MVP flows
Some checks failed
PR Checks / typecheck-and-build (push) Has been cancelled

This commit is contained in:
2026-03-07 09:51:18 -05:00
parent f69e5b671b
commit 52136271d3
26 changed files with 2719 additions and 243 deletions

View File

@@ -0,0 +1,41 @@
ALTER TABLE `watchlist_item` ADD `status` text NOT NULL DEFAULT 'backlog';
--> statement-breakpoint
ALTER TABLE `watchlist_item` ADD `priority` text NOT NULL DEFAULT 'medium';
--> statement-breakpoint
ALTER TABLE `watchlist_item` ADD `updated_at` text NOT NULL DEFAULT '';
--> statement-breakpoint
UPDATE `watchlist_item`
SET `status` = 'backlog'
WHERE `status` IS NULL OR TRIM(`status`) = '';
--> statement-breakpoint
UPDATE `watchlist_item`
SET `priority` = 'medium'
WHERE `priority` IS NULL OR TRIM(`priority`) = '';
--> statement-breakpoint
UPDATE `watchlist_item`
SET `updated_at` = COALESCE(NULLIF(`created_at`, ''), CURRENT_TIMESTAMP)
WHERE `updated_at` IS NULL OR TRIM(`updated_at`) = '';
--> statement-breakpoint
ALTER TABLE `watchlist_item` ADD `last_reviewed_at` text;
--> statement-breakpoint
ALTER TABLE `holding` ADD `company_name` text;
--> statement-breakpoint
CREATE INDEX `watchlist_user_updated_idx` ON `watchlist_item` (`user_id`, `updated_at`);
--> statement-breakpoint
CREATE TABLE `research_journal_entry` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`user_id` text NOT NULL,
`ticker` text NOT NULL,
`accession_number` text,
`entry_type` text NOT NULL,
`title` text,
`body_markdown` text NOT NULL,
`metadata` text,
`created_at` text NOT NULL,
`updated_at` text NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE INDEX `research_journal_ticker_idx` ON `research_journal_entry` (`user_id`, `ticker`, `created_at`);
--> statement-breakpoint
CREATE INDEX `research_journal_accession_idx` ON `research_journal_entry` (`user_id`, `accession_number`);