Skip to content

Commit

Permalink
Added a 'deleted_at' column to soft-delete records in the 'users' tab…
Browse files Browse the repository at this point in the history
…le. (#89)

Co-authored-by: GitHub Gen Changes <>
  • Loading branch information
ariga-bot authored Sep 3, 2024
1 parent 8aac26e commit 6a7ac73
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dirs/ecommerce/migrations/20240903131010.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "users" table
ALTER TABLE `users` ADD COLUMN `deleted_at` timestamp NULL;
3 changes: 2 additions & 1 deletion dirs/ecommerce/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:aBEg8MJdkSaquBFGMVyT/QIkOt6AnHqP/bgsJWj6lqM=
h1:55qUC1rpNkBuvU+91gLBMyG7VZXdXEn8DgVLkEbYkfM=
20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo=
20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY=
20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA=
Expand Down Expand Up @@ -43,3 +43,4 @@ h1:aBEg8MJdkSaquBFGMVyT/QIkOt6AnHqP/bgsJWj6lqM=
20240827130923.sql h1:twxLs8CDVZtIiez6dyrK1rJ0x0TKWHRwj7Hlf+yUs7Y=
20240829131016.sql h1:0zYZTAkT2bM3KovKz9e3KrmSKjwqM7qbkIHK1Yybh2c=
20240901130920.sql h1:Dq3nUz8IibffiSag7Lw7UZjTM0Dj8EZssyn5mUSqX84=
20240903131010.sql h1:GGqMn45ltGFdUkBkGu+Z1BK582+Cb3jPSv0PtZDyg80=
3 changes: 2 additions & 1 deletion dirs/ecommerce/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CREATE TABLE `users` (
`address` varchar(255) NULL,
`profile_picture_url` varchar(255) NULL,
`phone_verified` bool NOT NULL DEFAULT 0,
`deleted_at` timestamp NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `email` (`email`),
UNIQUE INDEX `user_name` (`user_name`),
Expand Down Expand Up @@ -139,4 +140,4 @@ CREATE TABLE `payment_methods` (
PRIMARY KEY (`id`),
INDEX `user_id` (`user_id`),
CONSTRAINT `payment_methods_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE
) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;

0 comments on commit 6a7ac73

Please sign in to comment.