aiai-bot commented on PR #3953:
URL: https://github.com/apache/hertzbeat/pull/3953#issuecomment-3743556769

   <!-- code-pr-reviewer -->
   ## Blocking Issues
   
   **MonitorBind.java:47** - Typo in index name `index_monitor_bin` → should be 
`idx_monitor_bind_monitor_id` for consistency with new naming convention.
   
   **Migration scripts (all 3 DBs)** - `component_id` index creation is 
conditional (skips if "assumed" auto-created by FK), but 
`StatusPageIncidentComponentBind` has no explicit `@JoinColumn`. Risk: missing 
index on `component_id` hurting query performance. **Fix**: Add explicit 
`@Index(name = "idx_incident_component_component_id", columnList = 
"component_id")` to entity and force creation in migration scripts.
   
   **EntityIndexIntegrationTest.java** - Only validates JPA `ddl-auto`, does 
NOT verify Flyway migration scripts (`V181__update_indexes.sql`) actually 
execute correctly. Production upgrades may fail due to undetected SQL syntax 
errors. **Fix**: Add test enabling Flyway, executing migrations, and validating 
indexes match entity definitions.
   
   **Database compatibility** - Tests use H2 (`MODE=MySQL`) only. 
MySQL/PostgreSQL migration scripts use different syntax (stored 
procedures/anonymous blocks) and may fail on real databases. **Fix**: Add 
Testcontainers-based tests for native MySQL and PostgreSQL.
   
   ---
   
   ## Suggested Tests
   - Enable Flyway in integration test to verify `V181__update_indexes.sql` 
execution
   - Add Testcontainers tests for native MySQL and PostgreSQL compatibility
   - Test upgrade scenario from V180 → V181 and validate index consistency


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to