From c254f8b76672baadb79ce4c570e43be963bebac6 Mon Sep 17 00:00:00 2001 From: GitHub Gen Changes <> Date: Sun, 28 Jul 2024 13:06:49 +0000 Subject: [PATCH] Removed the 'comments' table. --- dirs/ecommerce/migrations/20240728130649.sql | 4 ++++ dirs/ecommerce/migrations/atlas.sum | 3 ++- dirs/ecommerce/schema.sql | 21 +++----------------- 3 files changed, 9 insertions(+), 19 deletions(-) create mode 100644 dirs/ecommerce/migrations/20240728130649.sql diff --git a/dirs/ecommerce/migrations/20240728130649.sql b/dirs/ecommerce/migrations/20240728130649.sql new file mode 100644 index 0000000..a5e1ff3 --- /dev/null +++ b/dirs/ecommerce/migrations/20240728130649.sql @@ -0,0 +1,4 @@ +-- Modify "comments" table +ALTER TABLE `comments` DROP FOREIGN KEY `comments_ibfk_1`, DROP FOREIGN KEY `comments_ibfk_2`; +-- Drop "comments" table +DROP TABLE `comments`; diff --git a/dirs/ecommerce/migrations/atlas.sum b/dirs/ecommerce/migrations/atlas.sum index 0a7a6fa..21ecc46 100644 --- a/dirs/ecommerce/migrations/atlas.sum +++ b/dirs/ecommerce/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:ayF4SdmGNJPAnXTVxO6kwG4vxt98aJQaqurGP+fsnfs= +h1:6RkcQGhla6Li+07+718cEPKepozDfJJr1YXze1RD+Vg= 20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo= 20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY= 20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA= @@ -27,3 +27,4 @@ h1:ayF4SdmGNJPAnXTVxO6kwG4vxt98aJQaqurGP+fsnfs= 20240721130705.sql h1:PeB5YebwZvu8tQrL6vMrPtL/PVLsgkZrw15bQx8Z/cc= 20240723130918.sql h1:7UFf+5hmmm/hJZdmF1lvHCz+GYQKbSkxAUK6Q41kVXs= 20240725130853.sql h1:8wHRNNINenYDpavChvcXopJj7i2i88dKydkPoZ+3biE= +20240728130649.sql h1:vFpJKysr7Xtov1nmHM5lMRHlkJ9fMd1yDM4Snc1xyDk= diff --git a/dirs/ecommerce/schema.sql b/dirs/ecommerce/schema.sql index de33893..84fc04f 100644 --- a/dirs/ecommerce/schema.sql +++ b/dirs/ecommerce/schema.sql @@ -1,4 +1,4 @@ --- Create 'users' table + -- Create 'users' table CREATE TABLE `users` ( `id` int NOT NULL, `user_name` varchar(255) NOT NULL, @@ -52,22 +52,6 @@ CONSTRAINT `product_reviews_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `produ CONSTRAINT `product_reviews_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE ) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci; --- Create 'comments' table -CREATE TABLE `comments` ( -`id` int NOT NULL, -`user_id` int NOT NULL, -`review_id` int NULL, -`parent_comment_id` int NULL, -`comment_text` text NOT NULL, -PRIMARY KEY (`id`), -INDEX `parent_comment_id` (`parent_comment_id`), -INDEX `review_id` (`review_id`), -INDEX `user_id` (`user_id`), -CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE, -CONSTRAINT `comments_ibfk_2` FOREIGN KEY (`review_id`) REFERENCES `product_reviews` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE, -CONSTRAINT `comments_ibfk_3` FOREIGN KEY (`parent_comment_id`) REFERENCES `comments` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE -) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci; - -- Create 'fulfillment_centers' table CREATE TABLE `fulfillment_centers` ( `id` int NOT NULL, @@ -129,4 +113,5 @@ CREATE TABLE `posts` ( PRIMARY KEY (`id`), INDEX `user_id` (`user_id`), CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE -) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci; \ No newline at end of file +) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci; +