@crewx/sdk 0.9.0-rc.163 → 0.9.0-rc.164

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,54 @@
1
+ CREATE TABLE IF NOT EXISTS `sidebar_closed_tabs` (
2
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
3
+ `workspace_id` text NOT NULL,
4
+ `thread_id` text NOT NULL,
5
+ `group_id` text,
6
+ `position` integer NOT NULL,
7
+ `closed_at` text NOT NULL,
8
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE cascade,
9
+ FOREIGN KEY (`thread_id`) REFERENCES `threads`(`id`) ON UPDATE no action ON DELETE cascade,
10
+ FOREIGN KEY (`group_id`) REFERENCES `sidebar_groups`(`id`) ON UPDATE no action ON DELETE set null
11
+ );
12
+ --> statement-breakpoint
13
+ CREATE INDEX IF NOT EXISTS `idx_sidebar_closed_tabs_workspace_id` ON `sidebar_closed_tabs` (`workspace_id`,`id`);--> statement-breakpoint
14
+ CREATE TABLE IF NOT EXISTS `sidebar_groups` (
15
+ `id` text PRIMARY KEY NOT NULL,
16
+ `workspace_id` text NOT NULL,
17
+ `name` text NOT NULL,
18
+ `color` text NOT NULL,
19
+ `collapsed` integer DEFAULT 0 NOT NULL,
20
+ `position` integer NOT NULL,
21
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE cascade,
22
+ CONSTRAINT "sidebar_groups_color_ck" CHECK("sidebar_groups"."color" IN ('cyan', 'orange', 'purple', 'blue')),
23
+ CONSTRAINT "sidebar_groups_collapsed_ck" CHECK("sidebar_groups"."collapsed" IN (0, 1))
24
+ );
25
+ --> statement-breakpoint
26
+ CREATE INDEX IF NOT EXISTS `idx_sidebar_groups_workspace_position` ON `sidebar_groups` (`workspace_id`,`position`);--> statement-breakpoint
27
+ CREATE TABLE IF NOT EXISTS `sidebar_states` (
28
+ `workspace_id` text PRIMARY KEY NOT NULL,
29
+ `revision` integer DEFAULT 0 NOT NULL,
30
+ `rail_collapsed` integer DEFAULT 0 NOT NULL,
31
+ `seeded_at` text NOT NULL,
32
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE cascade,
33
+ CONSTRAINT "sidebar_states_rail_collapsed_ck" CHECK("sidebar_states"."rail_collapsed" IN (0, 1))
34
+ );
35
+ --> statement-breakpoint
36
+ CREATE TABLE IF NOT EXISTS `sidebar_tabs` (
37
+ `workspace_id` text NOT NULL,
38
+ `thread_id` text NOT NULL,
39
+ `group_id` text,
40
+ `position` integer NOT NULL,
41
+ PRIMARY KEY(`workspace_id`, `thread_id`),
42
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE cascade,
43
+ FOREIGN KEY (`thread_id`) REFERENCES `threads`(`id`) ON UPDATE no action ON DELETE cascade,
44
+ FOREIGN KEY (`group_id`) REFERENCES `sidebar_groups`(`id`) ON UPDATE no action ON DELETE set null
45
+ );
46
+ --> statement-breakpoint
47
+ CREATE TABLE IF NOT EXISTS `thread_reads` (
48
+ `workspace_id` text NOT NULL,
49
+ `thread_id` text NOT NULL,
50
+ `read_through_at` text NOT NULL,
51
+ PRIMARY KEY(`workspace_id`, `thread_id`),
52
+ FOREIGN KEY (`workspace_id`) REFERENCES `workspaces`(`id`) ON UPDATE no action ON DELETE cascade,
53
+ FOREIGN KEY (`thread_id`) REFERENCES `threads`(`id`) ON UPDATE no action ON DELETE cascade
54
+ );