Add hybrid research copilot workspace
This commit is contained in:
36
drizzle/0013_research_copilot.sql
Normal file
36
drizzle/0013_research_copilot.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
CREATE TABLE `research_copilot_session` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`user_id` text NOT NULL,
|
||||
`ticker` text NOT NULL,
|
||||
`title` text,
|
||||
`selected_sources` text NOT NULL DEFAULT '["documents","filings","research"]',
|
||||
`pinned_artifact_ids` text NOT NULL DEFAULT '[]',
|
||||
`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 UNIQUE INDEX `research_copilot_session_ticker_uidx` ON `research_copilot_session` (`user_id`,`ticker`);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `research_copilot_session_updated_idx` ON `research_copilot_session` (`user_id`,`updated_at`);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `research_copilot_message` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`session_id` integer NOT NULL,
|
||||
`user_id` text NOT NULL,
|
||||
`role` text NOT NULL,
|
||||
`content_markdown` text NOT NULL,
|
||||
`citations` text,
|
||||
`follow_ups` text,
|
||||
`suggested_actions` text,
|
||||
`selected_sources` text,
|
||||
`pinned_artifact_ids` text,
|
||||
`memo_section` text,
|
||||
`created_at` text NOT NULL,
|
||||
FOREIGN KEY (`session_id`) REFERENCES `research_copilot_session`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `research_copilot_message_session_idx` ON `research_copilot_message` (`session_id`,`created_at`);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `research_copilot_message_user_idx` ON `research_copilot_message` (`user_id`,`created_at`);
|
||||
@@ -85,6 +85,20 @@
|
||||
"when": 1773180000000,
|
||||
"tag": "0011_remove_legacy_xbrl_defaults",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 12,
|
||||
"version": "6",
|
||||
"when": 1773309600000,
|
||||
"tag": "0012_company_overview_cache",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 13,
|
||||
"version": "6",
|
||||
"when": 1773514800000,
|
||||
"tag": "0013_research_copilot",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user