You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: close Liquibase schema integrity and validation gaps #68
PR #67 introduced Liquibase as the schema owner. The initial implementation starts successfully on a fresh MySQL 8.4 database, but review found integrity and test-validation gaps that will be fixed separately rather than expanding that PR.
Work
Add a guarded unique constraint on refresh_tokens.users_id so the database matches the @OneToOne entity mapping and enforces one refresh token per user.
Tighten the existing-schema checks for follows(follower_id, following_id) and likes(users_id, posts_id). A unique index with extra columns must not be accepted as the required two-column constraint.
Stop tests from letting Hibernate repair the Liquibase schema:
map Posts.originalPostId and Posts.replyToId consistently as BINARY(16);
change the test profile from ddl-auto=update to ddl-auto=validate.
Acceptance criteria
Fresh MySQL schemas enforce one refresh-token row per user.
Existing three-column unique indexes do not satisfy either two-column constraint precondition.
The test suite passes with Hibernate schema validation and without automatic schema updates.
A focused test covers the constraint/precondition behavior.
./mvnw clean verify passes.
Origin
Introduced with the Liquibase baseline in PR #67. Implementation is intentionally deferred to this follow-up issue.
Activity