Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

solved #56

wants to merge 2 commits into from

Conversation

NikitaLafinskiy
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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,

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,

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,

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.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants