add missing indexes on all foreign keys#820
Conversation
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
|
Warning Review limit reached
More reviews will be available in 4 minutes and 39 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds database indexes to nine JPA entities and their collection/join tables via ChangesDatabase index optimization
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/resources/db/changelog/changesets/changelog_20260522T143544Z.xml (1)
3-6: ⚡ Quick winAlign index naming with entity mapping to avoid schema drift.
Line 4 uses
VariationFilter_assignment_id_idx, while the entity mapping usesvariation_filter_assignment_id_idx. Keep a single canonical name across JPA and Liquibase.Proposed fix
- <createIndex indexName="VariationFilter_assignment_id_idx" tableName="variation_filter"> + <createIndex indexName="variation_filter_assignment_id_idx" tableName="variation_filter">🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/resources/db/changelog/changesets/changelog_20260522T143544Z.xml` around lines 3 - 6, The Liquibase changeSet with id "1779460567128-3" creates an index named "VariationFilter_assignment_id_idx" on table "variation_filter" for column "assignment_id" which does not match the JPA/entity index name "variation_filter_assignment_id_idx"; rename the index in this changeSet to "variation_filter_assignment_id_idx" so the created index name aligns with the entity mapping and prevents schema drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pom.xml`:
- Line 24: The pom.xml's <version> element was changed to "2.35.0-SNAPSHOT"
which looks like an accidental rollback unrelated to this indexing PR; either
confirm this version bump is intentional or revert the <version> value to the
previous snapshot/release value used before the change (restore the prior
version string), and if intentional, add a short commit message or PR note
explaining why the module version was modified.
---
Nitpick comments:
In `@src/main/resources/db/changelog/changesets/changelog_20260522T143544Z.xml`:
- Around line 3-6: The Liquibase changeSet with id "1779460567128-3" creates an
index named "VariationFilter_assignment_id_idx" on table "variation_filter" for
column "assignment_id" which does not match the JPA/entity index name
"variation_filter_assignment_id_idx"; rename the index in this changeSet to
"variation_filter_assignment_id_idx" so the created index name aligns with the
entity mapping and prevents schema drift.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 17820fa5-9d01-4930-b7f3-db8ffd8e0125
📒 Files selected for processing (13)
pom.xmlsrc/main/java/org/gridsuite/modification/server/entities/catalog/LimitsForLineTypeEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/creation/ConverterStationCreationEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/creation/CreateVoltageLevelTopologyEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/creation/LccConverterStationCreationEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/deletion/ByFilterDeletionEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/modification/ConverterStationModificationEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/modification/LccConverterStationModificationEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/modification/LimitsPropertyEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/modification/MoveVoltageLevelFeederBaysEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/modification/VariationFilterEntity.javasrc/main/resources/db/changelog/changesets/changelog_20260522T143544Z.xmlsrc/main/resources/db/changelog/db.changelog-master.yaml
| @JoinTable( | ||
| name = "byFilterDeletionFilters", | ||
| joinColumns = @JoinColumn(name = "id"), foreignKey = @ForeignKey(name = "by_filter_deletion_id_fk"), | ||
| indexes = @Index(name = "by_filter_deletion_filters_id_idx", columnList = "id"), |
There was a problem hiding this comment.
Add the another foreign key
|
Actionable comments posted: 0 |
|



PR Summary