add missing indexes on all foreign keys#820
Conversation
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request adds database indexes to optimize query performance across multiple JPA entities. The changes include Maven build configuration updates to pin Liquibase version 4.31.1, JPA entity annotation updates to declare indexes on collection tables and join tables, and a corresponding Liquibase database migration to create those indexes in the schema. 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
| <groupId>org.gridsuite</groupId> | ||
| <artifactId>gridsuite-network-modification-server</artifactId> | ||
| <version>2.36.0-SNAPSHOT</version> | ||
| <version>2.35.0-SNAPSHOT</version> |
There was a problem hiding this comment.
Potentially accidental project version rollback
Line 24 sets the module version to 2.35.0-SNAPSHOT, which appears unrelated to this indexing PR and can disrupt expected snapshot progression if unintended. Please confirm or revert.
Suggested correction
- <version>2.35.0-SNAPSHOT</version>
+ <version>2.36.0-SNAPSHOT</version>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <version>2.35.0-SNAPSHOT</version> | |
| <version>2.36.0-SNAPSHOT</version> |
🤖 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 `@pom.xml` at 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.
|



PR Summary