aboutsummaryrefslogtreecommitdiff
path: root/drizzle/0006_chunky_meteorite.sql
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-09-30 22:13:07 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-09-30 22:13:07 +0200
commita725d4c7d28fee701b6997cc46cffddefbcd26bf (patch)
tree1e0899dc9fa67f8c74d7e4b7023881959d571d4f /drizzle/0006_chunky_meteorite.sql
parenta17b24b8e95bf85a8522fc0c2cbbdb8da31bf018 (diff)
Allow granular routine frequencies like 5/2w
Diffstat (limited to 'drizzle/0006_chunky_meteorite.sql')
-rw-r--r--drizzle/0006_chunky_meteorite.sql19
1 files changed, 19 insertions, 0 deletions
diff --git a/drizzle/0006_chunky_meteorite.sql b/drizzle/0006_chunky_meteorite.sql
new file mode 100644
index 0000000..471abc5
--- /dev/null
+++ b/drizzle/0006_chunky_meteorite.sql
@@ -0,0 +1,19 @@
+PRAGMA foreign_keys=OFF;--> statement-breakpoint
+CREATE TABLE `__new_routines` (
+ `id` integer NOT NULL,
+ `version` integer NOT NULL,
+ `project_id` integer NOT NULL,
+ `name` text NOT NULL,
+ `frequency` text NOT NULL,
+ `description` text DEFAULT '' NOT NULL,
+ `archived` integer DEFAULT false NOT NULL,
+ `archived_at` text,
+ `created_at` text NOT NULL,
+ PRIMARY KEY(`id`, `version`),
+ FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
+INSERT INTO `__new_routines`("id", "version", "project_id", "name", "frequency", "description", "archived", "archived_at", "created_at") SELECT "id", "version", "project_id", "name", "frequency_days" || 'd', "description", "archived", "archived_at", "created_at" FROM `routines`;--> statement-breakpoint
+DROP TABLE `routines`;--> statement-breakpoint
+ALTER TABLE `__new_routines` RENAME TO `routines`;--> statement-breakpoint
+PRAGMA foreign_keys=ON; \ No newline at end of file