@cleocode/cleo 2026.3.1 → 2026.3.2
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.
- package/drizzle/20260301175940_futuristic_eternity/migration.sql +5 -0
- package/drizzle/20260301175940_futuristic_eternity/snapshot.json +2608 -0
- package/drizzle/20260301180528_update-task-relations-check-constraint/migration.sql +21 -0
- package/drizzle/20260301180528_update-task-relations-check-constraint/snapshot.json +2608 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Update CHECK constraint on task_relations.relation_type to allow all 7 relation types
|
|
2
|
+
-- and add reason column. Previous CHECK only allowed: related, blocks, duplicates.
|
|
3
|
+
-- New CHECK allows: related, blocks, duplicates, absorbs, fixes, extends, supersedes.
|
|
4
|
+
-- SQLite requires table rebuild to modify CHECK constraints.
|
|
5
|
+
-- The source table may or may not have a reason column (depending on DB history),
|
|
6
|
+
-- so we copy only the 3 guaranteed columns and default reason to NULL.
|
|
7
|
+
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
8
|
+
CREATE TABLE `__new_task_relations` (
|
|
9
|
+
`task_id` text NOT NULL,
|
|
10
|
+
`related_to` text NOT NULL,
|
|
11
|
+
`relation_type` text DEFAULT 'related' NOT NULL,
|
|
12
|
+
`reason` text,
|
|
13
|
+
CONSTRAINT `task_relations_pk` PRIMARY KEY(`task_id`, `related_to`),
|
|
14
|
+
CONSTRAINT `fk_task_relations_task_id_tasks_id_fk` FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`) ON DELETE CASCADE,
|
|
15
|
+
CONSTRAINT `fk_task_relations_related_to_tasks_id_fk` FOREIGN KEY (`related_to`) REFERENCES `tasks`(`id`) ON DELETE CASCADE,
|
|
16
|
+
CONSTRAINT "chk_task_relations_relation_type" CHECK("relation_type" IN ('related','blocks','duplicates','absorbs','fixes','extends','supersedes'))
|
|
17
|
+
);--> statement-breakpoint
|
|
18
|
+
INSERT INTO `__new_task_relations`(`task_id`, `related_to`, `relation_type`) SELECT `task_id`, `related_to`, `relation_type` FROM `task_relations`;--> statement-breakpoint
|
|
19
|
+
DROP TABLE `task_relations`;--> statement-breakpoint
|
|
20
|
+
ALTER TABLE `__new_task_relations` RENAME TO `task_relations`;--> statement-breakpoint
|
|
21
|
+
PRAGMA foreign_keys=ON;
|