@zodic/shared 0.0.20 → 0.0.22

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 @@
1
+ ALTER TABLE `generations` ADD `archetype_index` integer;
@@ -0,0 +1,26 @@
1
+ PRAGMA foreign_keys=OFF;--> statement-breakpoint
2
+ CREATE TABLE `__new_generations` (
3
+ `id` text PRIMARY KEY NOT NULL,
4
+ `user_id` text,
5
+ `artifact_id` text,
6
+ `archetype_index` integer,
7
+ `user_artifact_id` text,
8
+ `gender` text,
9
+ `concept_combination_id` text,
10
+ `type` text NOT NULL,
11
+ `status` text DEFAULT 'pending' NOT NULL,
12
+ `url` text,
13
+ `created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
14
+ `updated_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
15
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
16
+ FOREIGN KEY (`artifact_id`) REFERENCES `artifacts`(`id`) ON UPDATE no action ON DELETE cascade,
17
+ FOREIGN KEY (`user_artifact_id`) REFERENCES `user_artifacts`(`id`) ON UPDATE no action ON DELETE cascade,
18
+ FOREIGN KEY (`concept_combination_id`) REFERENCES `concept_combinations`(`id`) ON UPDATE no action ON DELETE cascade
19
+ );
20
+ --> statement-breakpoint
21
+ INSERT INTO `__new_generations`("id", "user_id", "artifact_id", "archetype_index", "user_artifact_id", "gender", "concept_combination_id", "type", "status", "url", "created_at", "updated_at") SELECT "id", "user_id", "artifact_id", "archetype_index", "user_artifact_id", "gender", "concept_combination_id", "type", "status", "url", "created_at", "updated_at" FROM `generations`;--> statement-breakpoint
22
+ DROP TABLE `generations`;--> statement-breakpoint
23
+ ALTER TABLE `__new_generations` RENAME TO `generations`;--> statement-breakpoint
24
+ PRAGMA foreign_keys=ON;--> statement-breakpoint
25
+ CREATE INDEX `generations_user_id_idx` ON `generations` (`user_id`);--> statement-breakpoint
26
+ CREATE INDEX `generations_concept_combination_id_idx` ON `generations` (`concept_combination_id`);