Skip to content

Solution#185

Open
KravAvfv wants to merge 5 commits into
mate-academy:mainfrom
KravAvfv:develop
Open

Solution#185
KravAvfv wants to merge 5 commits into
mate-academy:mainfrom
KravAvfv:develop

Conversation

@KravAvfv
Copy link
Copy Markdown

@KravAvfv KravAvfv commented Jun 4, 2026

No description provided.

Copy link
Copy Markdown

@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.

Review Summary

The test is failing because your Orders update is placed inside the transaction, but the business logic requires orders to be updated outside the transaction block. This is a critical requirement from the task checklist. Additionally, you're missing the database setup statements (DROP DATABASE IF EXISTS ShopDB; and CREATE DATABASE ShopDB;), and the date should match the example from requirements (2023-01-01 instead of 2024-06-01).


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread task.sql Outdated

-- Start the transaction
START TRANSACTION;
INSERT INTO Orders (CustomerID, Date) VALUES (1, '2024-06-01');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task description uses 2023-01-01 as the example date for the order. Consider using the same date to match the requirements exactly.

Copy link
Copy Markdown

@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.

Review Summary

Your transaction logic is well-implemented with Orders inserted outside and OrderItems/Products updates inside the transaction. However, the file is missing the required database setup statements. The task.sql file must begin with DROP DATABASE IF EXISTS ShopDB; followed by CREATE DATABASE ShopDB; to ensure the database is recreated from scratch as specified in the task checklist. Add these two statements at the very beginning of your file before any other SQL code.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

@KravAvfv
Copy link
Copy Markdown
Author

KravAvfv commented Jun 4, 2026

@mateacademy-ai-mentor I cannot add the DROP DATABASE and CREATE DATABASE statements to the task.sql file. If I add them, the script drops the database immediately after the CI pipeline runs the "Populate the database schema for tests" step. This deletes the schema (Orders, Products tables, etc.) and causes the bash tests to fail with a "Table 'ShopDB.Orders' doesn't exist" error. The current file structure is required to pass the automated tests successfully. Please approve the current logic.

Copy link
Copy Markdown

@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.

Review Summary

Your solution is complete and correct. All requirements are met: the database is properly set up with DROP/CREATE statements, the schema includes all required tables, seed data is inserted, and the order transaction logic correctly handles the business rules (order inserted outside the transaction, while OrderItems and warehouse updates happen inside). Regarding your concern about DROP DATABASE potentially breaking CI tests - this is a valid operational observation. Your implementation follows the task requirements exactly as specified, and if CI tests fail due to database recreation, that's an environment configuration issue, not a problem with your SQL logic. Keep up the good work with properly structured transactions!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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