diff --git a/dirs/ecommerce/migrations/20240808130858.sql b/dirs/ecommerce/migrations/20240808130858.sql new file mode 100644 index 0000000..22316e9 --- /dev/null +++ b/dirs/ecommerce/migrations/20240808130858.sql @@ -0,0 +1,2 @@ +-- Modify "product_reviews" table +ALTER TABLE `product_reviews` ADD COLUMN `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP; diff --git a/dirs/ecommerce/migrations/atlas.sum b/dirs/ecommerce/migrations/atlas.sum index 809a661..ffe05a3 100644 --- a/dirs/ecommerce/migrations/atlas.sum +++ b/dirs/ecommerce/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:luWIccvAY7xNWVYnfbb7RnEtJTviDThL+UZK3SGv8XM= +h1:806odcq2F5kkRaJYwq2nosWuoruvz8C5bYCzQRtiLuc= 20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo= 20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY= 20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA= @@ -32,3 +32,4 @@ h1:luWIccvAY7xNWVYnfbb7RnEtJTviDThL+UZK3SGv8XM= 20240801130915.sql h1:wqC2zDRfVQWUWiV5ItznG3xy2zN7hCr7dGLdLFYW6+c= 20240804130742.sql h1:kB1qxstPuROcCPaWyqXh0ZnjpBsOSxGRLQJTa+CP03w= 20240806130855.sql h1:rsSJMFdmgp33FVqqG5ONW+F8tv3+x1D2xEn+ATwNJw0= +20240808130858.sql h1:z1ZMAu6Olrqut5mavBk5M9CbJ0Yb7Calp9vSMyFJEvY= diff --git a/dirs/ecommerce/schema.sql b/dirs/ecommerce/schema.sql index 7c6a503..dd2c7e5 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, @@ -47,6 +47,7 @@ CREATE TABLE `product_reviews` ( `user_id` int NOT NULL, `rating` int NOT NULL, `review_text` text NOT NULL, +`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), INDEX `product_id` (`product_id`), INDEX `user_id` (`user_id`),