-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solved #56
base: main
Are you sure you want to change the base?
solved #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your hard work on this SQL script! 😊 You've done a great job in setting up the database and tables with the necessary relationships. However, there's a critical issue that needs to be addressed before we can approve the pull request. The foreign key columns (CustomerID
, OrderID
, and ProductID
) in your tables need to allow NULL values because the ON DELETE SET NULL
action is used. Without allowing NULLs, this will cause errors when trying to set these columns to NULL upon deletion of the referenced rows. Please update the column definitions to allow NULL values, and then we can proceed with approval. Keep up the great work! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
task.sql
Outdated
|
||
CREATE TABLE IF NOT EXISTS Orders ( | ||
ID INT AUTO_INCREMENT PRIMARY KEY, | ||
CustomerID INT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CustomerID
column should allow NULL values since the foreign key constraint uses ON DELETE SET NULL
. Add NULL
to the column definition to avoid errors.
task.sql
Outdated
|
||
CREATE TABLE IF NOT EXISTS OrderItems ( | ||
ID INT AUTO_INCREMENT PRIMARY KEY, | ||
OrderID INT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OrderID
column should allow NULL values since the foreign key constraint uses ON DELETE SET NULL
. Add NULL
to the column definition to avoid errors.
task.sql
Outdated
CREATE TABLE IF NOT EXISTS OrderItems ( | ||
ID INT AUTO_INCREMENT PRIMARY KEY, | ||
OrderID INT, | ||
ProductID INT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ProductID
column should allow NULL values since the foreign key constraint uses ON DELETE SET NULL
. Add NULL
to the column definition to avoid errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on addressing the previous critical issue by allowing NULL values for the foreign key columns (CustomerID
, OrderID
, and ProductID
) in the Orders
and OrderItems
tables. This change ensures that the ON DELETE SET NULL
action works correctly, preventing errors when referenced rows are deleted. Your code now meets the task requirements and is ready for approval. 🎉
While the decision is to approve, please review the comments to further improve your code. Addressing these points will help you avoid similar issues in the future and enhance your learning experience. Keep up the good work and continue to learn from each task! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
No description provided.