@uiid/bertrand 0.10.0

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,104 @@
1
+ CREATE TABLE `conversations` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `session_id` text NOT NULL,
4
+ `started_at` text DEFAULT (datetime('now')) NOT NULL,
5
+ `ended_at` text,
6
+ `discarded` integer DEFAULT false NOT NULL,
7
+ `last_question` text,
8
+ `event_count` integer DEFAULT 0 NOT NULL,
9
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade
10
+ );
11
+ --> statement-breakpoint
12
+ CREATE INDEX `conv_session` ON `conversations` (`session_id`);--> statement-breakpoint
13
+ CREATE TABLE `events` (
14
+ `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
15
+ `session_id` text NOT NULL,
16
+ `conversation_id` text,
17
+ `event` text NOT NULL,
18
+ `summary` text,
19
+ `meta` text,
20
+ `created_at` text DEFAULT (datetime('now')) NOT NULL,
21
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade,
22
+ FOREIGN KEY (`conversation_id`) REFERENCES `conversations`(`id`) ON UPDATE no action ON DELETE no action
23
+ );
24
+ --> statement-breakpoint
25
+ CREATE INDEX `ev_session` ON `events` (`session_id`);--> statement-breakpoint
26
+ CREATE INDEX `ev_session_event` ON `events` (`session_id`,`event`);--> statement-breakpoint
27
+ CREATE INDEX `ev_event_created` ON `events` (`event`,`created_at`);--> statement-breakpoint
28
+ CREATE INDEX `ev_conversation` ON `events` (`conversation_id`);--> statement-breakpoint
29
+ CREATE TABLE `groups` (
30
+ `id` text PRIMARY KEY NOT NULL,
31
+ `parent_id` text,
32
+ `slug` text NOT NULL,
33
+ `name` text NOT NULL,
34
+ `path` text NOT NULL,
35
+ `depth` integer DEFAULT 0 NOT NULL,
36
+ `color` text,
37
+ `created_at` text DEFAULT (datetime('now')) NOT NULL,
38
+ FOREIGN KEY (`parent_id`) REFERENCES `groups`(`id`) ON UPDATE no action ON DELETE cascade
39
+ );
40
+ --> statement-breakpoint
41
+ CREATE UNIQUE INDEX `groups_parent_slug` ON `groups` (`parent_id`,`slug`);--> statement-breakpoint
42
+ CREATE INDEX `groups_path` ON `groups` (`path`);--> statement-breakpoint
43
+ CREATE TABLE `labels` (
44
+ `id` text PRIMARY KEY NOT NULL,
45
+ `name` text NOT NULL,
46
+ `color` text,
47
+ `created_at` text DEFAULT (datetime('now')) NOT NULL
48
+ );
49
+ --> statement-breakpoint
50
+ CREATE UNIQUE INDEX `labels_name_unique` ON `labels` (`name`);--> statement-breakpoint
51
+ CREATE TABLE `session_labels` (
52
+ `session_id` text NOT NULL,
53
+ `label_id` text NOT NULL,
54
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade,
55
+ FOREIGN KEY (`label_id`) REFERENCES `labels`(`id`) ON UPDATE no action ON DELETE cascade
56
+ );
57
+ --> statement-breakpoint
58
+ CREATE UNIQUE INDEX `sl_pk` ON `session_labels` (`session_id`,`label_id`);--> statement-breakpoint
59
+ CREATE INDEX `sl_label` ON `session_labels` (`label_id`);--> statement-breakpoint
60
+ CREATE TABLE `session_stats` (
61
+ `session_id` text PRIMARY KEY NOT NULL,
62
+ `event_count` integer DEFAULT 0 NOT NULL,
63
+ `conversation_count` integer DEFAULT 0 NOT NULL,
64
+ `interaction_count` integer DEFAULT 0 NOT NULL,
65
+ `pr_count` integer DEFAULT 0 NOT NULL,
66
+ `claude_work_s` integer DEFAULT 0 NOT NULL,
67
+ `user_wait_s` integer DEFAULT 0 NOT NULL,
68
+ `active_pct` integer DEFAULT 0 NOT NULL,
69
+ `duration_s` integer DEFAULT 0 NOT NULL,
70
+ `updated_at` text DEFAULT (datetime('now')) NOT NULL,
71
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade
72
+ );
73
+ --> statement-breakpoint
74
+ CREATE TABLE `sessions` (
75
+ `id` text PRIMARY KEY NOT NULL,
76
+ `group_id` text NOT NULL,
77
+ `slug` text NOT NULL,
78
+ `name` text NOT NULL,
79
+ `status` text DEFAULT 'paused' NOT NULL,
80
+ `summary` text,
81
+ `pid` integer,
82
+ `started_at` text DEFAULT (datetime('now')) NOT NULL,
83
+ `ended_at` text,
84
+ `created_at` text DEFAULT (datetime('now')) NOT NULL,
85
+ `updated_at` text DEFAULT (datetime('now')) NOT NULL,
86
+ FOREIGN KEY (`group_id`) REFERENCES `groups`(`id`) ON UPDATE no action ON DELETE no action
87
+ );
88
+ --> statement-breakpoint
89
+ CREATE UNIQUE INDEX `sessions_group_slug` ON `sessions` (`group_id`,`slug`);--> statement-breakpoint
90
+ CREATE INDEX `sessions_status` ON `sessions` (`status`);--> statement-breakpoint
91
+ CREATE INDEX `sessions_started` ON `sessions` (`started_at`);--> statement-breakpoint
92
+ CREATE TABLE `worktree_associations` (
93
+ `id` text PRIMARY KEY NOT NULL,
94
+ `session_id` text NOT NULL,
95
+ `branch` text NOT NULL,
96
+ `worktree_path` text,
97
+ `active` integer DEFAULT true NOT NULL,
98
+ `entered_at` text DEFAULT (datetime('now')) NOT NULL,
99
+ `exited_at` text,
100
+ FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE cascade
101
+ );
102
+ --> statement-breakpoint
103
+ CREATE INDEX `wt_session` ON `worktree_associations` (`session_id`);--> statement-breakpoint
104
+ CREATE INDEX `wt_active` ON `worktree_associations` (`active`);
@@ -0,0 +1,23 @@
1
+ PRAGMA foreign_keys=OFF;--> statement-breakpoint
2
+ CREATE TABLE `__new_sessions` (
3
+ `id` text PRIMARY KEY NOT NULL,
4
+ `group_id` text NOT NULL,
5
+ `slug` text NOT NULL,
6
+ `name` text NOT NULL,
7
+ `status` text DEFAULT 'paused' NOT NULL,
8
+ `summary` text,
9
+ `pid` integer,
10
+ `started_at` text DEFAULT (datetime('now')) NOT NULL,
11
+ `ended_at` text,
12
+ `created_at` text DEFAULT (datetime('now')) NOT NULL,
13
+ `updated_at` text DEFAULT (datetime('now')) NOT NULL,
14
+ FOREIGN KEY (`group_id`) REFERENCES `groups`(`id`) ON UPDATE no action ON DELETE cascade
15
+ );
16
+ --> statement-breakpoint
17
+ INSERT INTO `__new_sessions`("id", "group_id", "slug", "name", "status", "summary", "pid", "started_at", "ended_at", "created_at", "updated_at") SELECT "id", "group_id", "slug", "name", "status", "summary", "pid", "started_at", "ended_at", "created_at", "updated_at" FROM `sessions`;--> statement-breakpoint
18
+ DROP TABLE `sessions`;--> statement-breakpoint
19
+ ALTER TABLE `__new_sessions` RENAME TO `sessions`;--> statement-breakpoint
20
+ PRAGMA foreign_keys=ON;--> statement-breakpoint
21
+ CREATE UNIQUE INDEX `sessions_group_slug` ON `sessions` (`group_id`,`slug`);--> statement-breakpoint
22
+ CREATE INDEX `sessions_status` ON `sessions` (`status`);--> statement-breakpoint
23
+ CREATE INDEX `sessions_started` ON `sessions` (`started_at`);
@@ -0,0 +1,3 @@
1
+ ALTER TABLE `session_stats` ADD `lines_added` integer DEFAULT 0 NOT NULL;--> statement-breakpoint
2
+ ALTER TABLE `session_stats` ADD `lines_removed` integer DEFAULT 0 NOT NULL;--> statement-breakpoint
3
+ ALTER TABLE `session_stats` ADD `files_touched` integer DEFAULT 0 NOT NULL;