Skip to content

Commit

Permalink
Added 'gender' column to the 'users' table with ENUM type for better …
Browse files Browse the repository at this point in the history
…data consistency. (#105)

Co-authored-by: GitHub Gen Changes <>
  • Loading branch information
ariga-bot authored Oct 29, 2024
1 parent 74cff74 commit 94a81ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dirs/ecommerce/migrations/20241029131228.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "users" table
ALTER TABLE `users` ADD COLUMN `gender` enum('male','female','other') NULL COMMENT "User gender";
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:NMi0fWXDuUkmq21unRIe6/tqtR44t7Mex/OPehuw+UA=
h1:STK2H155MS9kSfE50qCHNSawXtDIWlc1iuQS518bApQ=
20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo=
20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY=
20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA=
Expand Down Expand Up @@ -54,3 +54,4 @@ h1:NMi0fWXDuUkmq21unRIe6/tqtR44t7Mex/OPehuw+UA=
20241022103333_add_comments.sql h1:/H61oAHrzxI4ZgrNQMApyTLkYeOKZB4qaATCEHJHFI8=
20241027112248.sql h1:Uz/zd2cH0VzbQuO8TcENLacZimgQA9XIdHmL+det8Lc=
20241027144749.sql h1:0OTheGU7/lbJB+NXlrmAVMNonIFH89tj9dzW6EByorg=
20241029131228.sql h1:DzldiBTksxEdcKfy5vyShSvEE6Q5iU2m7NShpkUwCRA=
3 changes: 3 additions & 0 deletions dirs/ecommerce/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CREATE TABLE `users` (
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Timestamp of when the user was created',
`updated_at` timestamp NULL ON UPDATE CURRENT_TIMESTAMP COMMENT 'Timestamp of the last update to the user record',
`date_of_birth` date NULL,
`gender` ENUM('male', 'female', 'other') NULL COMMENT 'User gender',
`active` bool NOT NULL DEFAULT 1 COMMENT 'Flag indicating if the user account is active, defaults to true',
`last_login` timestamp NULL,
`address` varchar(255) NULL,
Expand Down Expand Up @@ -150,3 +151,5 @@ CREATE TABLE `payment_methods` (
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;


0 comments on commit 94a81ab

Please sign in to comment.