add missing indexes#813
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 (3)
📝 WalkthroughWalkthroughAdds JPA ChangesDatabase Indexes
Suggested reviewers:
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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
🤖 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 `@src/main/resources/db/changelog/changesets/changelog_20260513T140000Z.xml`:
- Around line 4-6: Several index names in the changelog XML exceed PostgreSQL's
63-char limit and must be shortened: update the createIndex indexName attributes
for the following entries to unique names under 63 chars—replace
boolean_equipment_attribute_modification_voltage_level_topology_modification_id_idx
with boolean_eq_attr_mod_vltm_id_idx (or similar <63 chars) for table
boolean_equipment_attribute_modification; replace
converter_station_creation_rcc_points_converter_station_creation_entity_id_idx
with conv_st_creation_rcc_points_entity_id_idx for table
converter_station_creation_rcc_points; replace
converter_station_modification_rcc_points_converter_station_modification_entity_id_idx
with conv_st_mod_rcc_points_entity_id_idx for table
converter_station_modification_rcc_points; replace
create_voltage_level_topology_switch_kinds_create_voltage_level_topology_id_idx
with vlt_switch_kinds_vlt_id_idx for table
create_voltage_level_topology_switch_kinds; replace
lcc_converter_station_modification_on_side_lcc_converter_station_modification_id_idx
with lcc_conv_st_mod_on_side_id_idx for table
lcc_converter_station_modification_on_side; and replace
shunt_compensator_on_side_lcc_converter_station_creation_entity_id_idx with
shunt_comp_on_side_conv_st_creation_id_idx for table shunt_compensator_on_side;
ensure each new name is unique, under 63 chars, update any references or tests
that expect the old names, and run migrations locally to confirm no collisions.
🪄 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: 6129f709-be5e-412c-a82e-09d56fb16a79
📒 Files selected for processing (2)
src/main/resources/db/changelog/changesets/changelog_20260513T140000Z.xmlsrc/main/resources/db/changelog/db.changelog-master.yaml
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/resources/db/changelog/changesets/changelog_20260513T140000Z.xml (1)
3-16: ⚡ Quick winConsider one
changeSetpercreateIndexfor safer deployments.Grouping all four
createIndexcalls in a single changeSet means: (a) if any one fails on a target environment, none of the four are recorded as applied; (b) re-running after a fix re-attempts the already-created ones (will fail unlessfailOnError/preconditions are set); (c) Liquibase's auto-rollback for index creation also operates on the whole batch. Splitting into one changeSet per index gives you per-index idempotency, partial progress, and granular rollback.Also, since these are pure index additions on existing tables, consider adding
<preConditions onFail="MARK_RAN"><indexExists indexName="..."/></preConditions>per changeSet so the migration is safe to re-run across environments where the index may already have been created out-of-band.Note: the two specific concerns on this file (redundant index on
substationModification.idand the name mismatch formodification_application_modification_uuid_idx) are flagged at the entity layer where they originate — see comments onSubstationModificationEntity.java(line 21) andModificationApplicationEntity.java(lines 28-31).🤖 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_20260513T140000Z.xml` around lines 3 - 16, Split the single changeSet into four separate changeSet entries (one per createIndex) so each index (boolean_equipment_attribute_modif_vl_topology_modif_id_idx, limits_property_modification_operational_limit_group_id_idx, modification_application_modification_uuid_idx, substationModification_id_idx) is applied independently; for each new changeSet add a preConditions block like onFail="MARK_RAN" with an indexExists check for that indexName to make the migration safe to re-run; also correct the index name for modification_application to match the entity-layer name and remove or omit the substationModification_id_idx if it is a redundant index on substationModification.id as flagged in SubstationModificationEntity.java.
🤖 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
`@src/main/java/org/gridsuite/modification/server/entities/ModificationApplicationEntity.java`:
- Around line 28-31: The `@Index` name in ModificationApplicationEntity (the
indexes array on the class) doesn’t match the Liquibase changelog name; change
the name value for the index currently declared as
"idx_modification_application_modification_uuid" in the `@Index` annotation to
"modification_application_modification_uuid_idx" so it exactly matches the
changelog entry (or alternatively update the changelog to
"idx_modification_application_modification_uuid" if you prefer the idx_ prefix)
— locate the indexes declaration on ModificationApplicationEntity and make the
names consistent between the `@Index` (annotation) and the Liquibase changeset.
---
Nitpick comments:
In `@src/main/resources/db/changelog/changesets/changelog_20260513T140000Z.xml`:
- Around line 3-16: Split the single changeSet into four separate changeSet
entries (one per createIndex) so each index
(boolean_equipment_attribute_modif_vl_topology_modif_id_idx,
limits_property_modification_operational_limit_group_id_idx,
modification_application_modification_uuid_idx, substationModification_id_idx)
is applied independently; for each new changeSet add a preConditions block like
onFail="MARK_RAN" with an indexExists check for that indexName to make the
migration safe to re-run; also correct the index name for
modification_application to match the entity-layer name and remove or omit the
substationModification_id_idx if it is a redundant index on
substationModification.id as flagged in SubstationModificationEntity.java.
🪄 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: 26e2b90e-a961-477b-9ec7-029076029062
📒 Files selected for processing (5)
src/main/java/org/gridsuite/modification/server/entities/ModificationApplicationEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/modification/LimitsPropertyModificationEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/modification/SubstationModificationEntity.javasrc/main/java/org/gridsuite/modification/server/entities/equipment/modification/attribute/BooleanEquipmentAttributeModificationEntity.javasrc/main/resources/db/changelog/changesets/changelog_20260513T140000Z.xml
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
|



PR Summary