Fixed 500 status on eco news comments like/dislike#8412
Fixed 500 status on eco news comments like/dislike#8412Andrii-Danylenko wants to merge 1 commit intodevfrom
Conversation
WalkthroughThis update introduces new Liquibase changesets that add composite primary key constraints to three database tables: Changes
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (4)
dao/src/main/resources/db/changelog/logs/ch-comments-users-dislike-table.xml (1)
42-46: Align changeSetidnaming conventionThe
id="1747141984482-1"format differs from other changeSets in this project (e.g., author-based or descriptive IDs). Consider adopting a consistent naming scheme—either a clear timestamp prefix or including the author—to maintain clarity and uniformity across your changelogs.dao/src/main/resources/db/changelog/logs/ch-add-table-notification-Mladonov.xml (1)
34-38: Ensure proper rollback for schema changeConsider adding a
<rollback>clause to drop thePK_notifications_usersconstraint. This keeps your changelog reversible and aligns with best practices for safe schema migrations.dao/src/main/resources/db/changelog/logs/ch-add-table-comments-users-likes-Fedotov.xml (2)
55-59: Add rollback for primary key changeIncluding a
<rollback>element to drop thePK_comments_users_likesconstraint ensures that reversing this changeset cleanly removes the primary key, preserving reversibility in your migration pipeline.
55-59: Normalize changeSet id formatThe
id="1747142053687-1"deviates from descriptive or author-based IDs seen elsewhere. Harmonizing the ID pattern across all changeSets will improve readability and traceability of schema changes.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
dao/src/main/resources/db/changelog/logs/ch-add-table-comments-users-likes-Fedotov.xml(1 hunks)dao/src/main/resources/db/changelog/logs/ch-add-table-notification-Mladonov.xml(1 hunks)dao/src/main/resources/db/changelog/logs/ch-comments-users-dislike-table.xml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
dao/src/main/resources/db/changelog/logs/ch-comments-users-dislike-table.xml
Show resolved
Hide resolved
dao/src/main/resources/db/changelog/logs/ch-add-table-notification-Mladonov.xml
Show resolved
Hide resolved
dao/src/main/resources/db/changelog/logs/ch-add-table-comments-users-likes-Fedotov.xml
Show resolved
Hide resolved
|
maks741
left a comment
There was a problem hiding this comment.
I believe you cannot simply edit already applied changelogs and exception about mismatching checksums will get thrown
Why not? Changesets are like commits. They are applied to each file separately. LiquidBase tracks file changes. |



Summary
During testing, I came across a bug related to the presence of duplicates when trying to retrieve records from the database.
Changes
I cleared the database of duplicates and added primary key constraints on tables to prevent duplicates in the future.
Summary by CodeRabbit