@zodic/shared 0.0.287 → 0.0.289
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,20 @@
|
|
|
1
|
+
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
2
|
+
CREATE TABLE `__new_user_concepts` (
|
|
3
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
4
|
+
`user_id` text NOT NULL,
|
|
5
|
+
`concept_id` text NOT NULL,
|
|
6
|
+
`concept_combination_id` text NOT NULL,
|
|
7
|
+
`created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
8
|
+
`updated_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
9
|
+
`image_idx` integer DEFAULT 0 NOT NULL,
|
|
10
|
+
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
11
|
+
FOREIGN KEY (`concept_id`) REFERENCES `concepts`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
12
|
+
FOREIGN KEY (`concept_combination_id`) REFERENCES `concept_combinations`(`id`) ON UPDATE no action ON DELETE cascade
|
|
13
|
+
);
|
|
14
|
+
--> statement-breakpoint
|
|
15
|
+
INSERT INTO `__new_user_concepts`("id", "user_id", "concept_id", "concept_combination_id", "created_at", "updated_at", "image_idx") SELECT "id", "user_id", "concept_id", "concept_combination_id", "created_at", "updated_at", "image_idx" FROM `user_concepts`;--> statement-breakpoint
|
|
16
|
+
DROP TABLE `user_concepts`;--> statement-breakpoint
|
|
17
|
+
ALTER TABLE `__new_user_concepts` RENAME TO `user_concepts`;--> statement-breakpoint
|
|
18
|
+
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
19
|
+
CREATE INDEX `user_concepts_user_id_idx` ON `user_concepts` (`user_id`);--> statement-breakpoint
|
|
20
|
+
CREATE INDEX `user_concepts_concept_id_idx` ON `user_concepts` (`concept_id`);
|