Skip to content

Commit

Permalink
Added a default value of 'guest' for the column in the 'users' table …
Browse files Browse the repository at this point in the history
…to accommodate users who might not want to provide a username initially.
  • Loading branch information
GitHub Gen Changes committed Dec 1, 2024
1 parent c956df1 commit 9643706
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dirs/ecommerce/migrations/20241201131146.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "users" table
ALTER TABLE `users` MODIFY COLUMN `user_name` varchar(255) NOT NULL DEFAULT "guest" COMMENT "The username of the user, must be unique";
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:3KMZhZ8WFcPIx6uZN2zxUsE7xfNNroCpbai+mszVAJg=
h1:6SfSd/+R+NzPukUqFaMZbxJTcoTeWZnmhNqRI4fv6pM=
20230316085611.sql h1:br6W6LPEnnsejlz/7hRm9zthwStCzjN2vZkqVPxlmvo=
20230316090502.sql h1:GfeRjkSeoCt3JVRtLQNa/r50lRfpAPXS7AqTU2ZNFgY=
20230531091333_products_categories.sql h1:59q2M59dV5dJNv4Lyb2TAJz8V6HekgkLn9z4DoL98jA=
Expand Down Expand Up @@ -63,3 +63,4 @@ h1:3KMZhZ8WFcPIx6uZN2zxUsE7xfNNroCpbai+mszVAJg=
20241119131322.sql h1:ih7jcLvWFqJnVYDUkMN8wZiKYkgbp65yCTSrzO6pkgg=
20241126131349.sql h1:7Ft68dDNVtYPdFgxuWUlfN96gM74nqPSHNL1IHitu2I=
20241128114310.sql h1:BEWCkwlqS1vHduvpN0PlbUZq1nwe/6iLCkrKfECzprk=
20241201131146.sql h1:DpGu1AoM2oW3V3uGz3Ye7iah6eUPPdFCDLZwI70NG+o=
2 changes: 1 addition & 1 deletion dirs/ecommerce/schema.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Create 'users' table
CREATE TABLE `users` (
`id` int NOT NULL COMMENT 'Unique identifier for each user',
`user_name` varchar(255) NOT NULL COMMENT 'The username of the user, must be unique',
`user_name` varchar(255) NOT NULL DEFAULT 'guest' COMMENT 'The username of the user, must be unique',
`email` varchar(255) NOT NULL,
`phone_number` varchar(15) NOT NULL,
`country_code` varchar(5) NOT NULL DEFAULT '+1' COMMENT 'Country code for the phone number, defaults to US',
Expand Down

0 comments on commit 9643706

Please sign in to comment.