Skip to content

Commit 6dacdd9

Browse files
authored
Merge branch 'main' into filterBasedContingencyList
2 parents 9f3fe7d + 91f969f commit 6dacdd9

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</developers>
4343

4444
<properties>
45-
<gridsuite-dependencies.version>42.0.0</gridsuite-dependencies.version>
45+
<gridsuite-dependencies.version>43.0.0</gridsuite-dependencies.version>
4646
<liquibase-hibernate-package>org.gridsuite.actions.server</liquibase-hibernate-package>
4747
<sonar.organization>gridsuite</sonar.organization>
4848
<sonar.projectKey>org.gridsuite:actions-server</sonar.projectKey>

src/main/java/org/gridsuite/actions/server/entities/IdBasedContingencyListEntity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
public class IdBasedContingencyListEntity extends AbstractContingencyEntity {
3434

3535
@OneToMany(cascade = CascadeType.ALL)
36+
@OrderColumn(name = "identifier_order")
3637
private List<IdentifierListEntity> identifiersListEntities;
3738

3839
public IdBasedContingencyListEntity(IdBasedContingencyList idBasedContingencyList) {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
2+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
3+
<changeSet author="braquartdav (generated)" id="1756286263175-7">
4+
<addColumn tableName="id_based_contingency_list_identifiers_list_entities">
5+
<column name="identifier_order" type="integer"/>
6+
</addColumn>
7+
<!-- mandatory: init this new column with a default order -->
8+
<sql dbms="postgresql">
9+
WITH ordered_aleas AS (
10+
SELECT identifiers_list_entities_id, ROW_NUMBER() OVER (PARTITION BY id_based_contingency_list_entity_id
11+
ORDER BY identifiers_list_entities_id) - 1 as id_order
12+
FROM id_based_contingency_list_identifiers_list_entities
13+
)
14+
UPDATE id_based_contingency_list_identifiers_list_entities a
15+
SET identifier_order = oa.id_order
16+
FROM ordered_aleas oa
17+
WHERE a.identifiers_list_entities_id = oa.identifiers_list_entities_id;
18+
</sql>
19+
</changeSet>
20+
</databaseChangeLog>

src/main/resources/db/changelog/db.changelog-master.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ databaseChangeLog:
4040
file: changesets/changelog_20250704T094426Z.xml
4141
relativeToChangelogFile: true
4242

43+
- include:
44+
file: changesets/changelog_20250827T091725Z.xml
45+
relativeToChangelogFile: true
46+
4347
- include:
4448
file: changesets/changelog_20250901T135222Z.xml
45-
relativeToChangelogFile: true
49+
relativeToChangelogFile: true

0 commit comments

Comments
 (0)