diff options
Diffstat (limited to 'drizzle/0006_chunky_meteorite.sql')
| -rw-r--r-- | drizzle/0006_chunky_meteorite.sql | 19 |
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 |
