Skip to content

Commit 11abced

Browse files
Add csv filename to tabular creation and modification (#666)
* Add csv filename in tabular creation/modification Signed-off-by: Franck LECUYER <[email protected]>
1 parent 4f75845 commit 11abced

File tree

6 files changed

+25
-2
lines changed

6 files changed

+25
-2
lines changed

src/main/java/org/gridsuite/modification/server/entities/tabular/TabularBaseEntity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public class TabularBaseEntity extends ModificationEntity {
3333
@OrderColumn(name = "insert_position")
3434
private List<TabularPropertyEntity> properties;
3535

36+
private String csvFilename;
37+
3638
protected TabularBaseEntity(TabularBaseInfos tabularBaseInfos) {
3739
super(tabularBaseInfos);
3840
assignAttributes(tabularBaseInfos);
@@ -57,5 +59,6 @@ private void assignAttributes(TabularBaseInfos tabularBaseInfos) {
5759
} else {
5860
this.properties = newProperties;
5961
}
62+
this.csvFilename = tabularBaseInfos.getCsvFilename();
6063
}
6164
}

src/main/java/org/gridsuite/modification/server/entities/tabular/TabularCreationEntity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public TabularCreationInfos toModificationInfos() {
6363
.properties(CollectionUtils.isEmpty(getProperties()) ? null : getProperties().stream()
6464
.map(TabularPropertyEntity::toInfos)
6565
.toList())
66+
.csvFilename(getCsvFilename())
6667
.build();
6768
}
6869

src/main/java/org/gridsuite/modification/server/entities/tabular/TabularModificationEntity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public TabularModificationInfos toModificationInfos() {
6161
.properties(CollectionUtils.isEmpty(getProperties()) ? null : getProperties().stream()
6262
.map(TabularPropertyEntity::toInfos)
6363
.toList())
64-
.build();
64+
.csvFilename(getCsvFilename())
65+
.build();
6566
}
6667

6768
@Override

src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ private TabularModificationInfos loadTabularModification(ModificationEntity modi
380380
.properties(CollectionUtils.isEmpty(tabularModificationEntity.getProperties()) ? null : tabularModificationEntity.getProperties().stream()
381381
.map(TabularPropertyEntity::toInfos)
382382
.toList())
383+
.csvFilename(tabularModificationEntity.getCsvFilename())
383384
.build();
384385
}
385386

@@ -429,7 +430,8 @@ private TabularCreationInfos loadTabularCreation(ModificationEntity modification
429430
.properties(CollectionUtils.isEmpty(tabularCreationEntity.getProperties()) ? null : tabularCreationEntity.getProperties().stream()
430431
.map(TabularPropertyEntity::toInfos)
431432
.toList())
432-
.build();
433+
.csvFilename(tabularCreationEntity.getCsvFilename())
434+
.build();
433435
}
434436

435437
public ModificationInfos getModificationInfos(ModificationEntity modificationEntity) {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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="lecuyerfra (generated)" id="1753776162554-45">
4+
<addColumn tableName="tabular_creation">
5+
<column name="csv_filename" type="varchar(255)"/>
6+
</addColumn>
7+
</changeSet>
8+
<changeSet author="lecuyerfra (generated)" id="1753776162554-46">
9+
<addColumn tableName="tabular_modification">
10+
<column name="csv_filename" type="varchar(255)"/>
11+
</addColumn>
12+
</changeSet>
13+
</databaseChangeLog>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,3 +387,6 @@ databaseChangeLog:
387387
- include:
388388
file: changesets/changelog_20250722T134355Z.xml
389389
relativeToChangelogFile: true
390+
- include:
391+
file: changesets/changelog_20250729T080203Z.xml
392+
relativeToChangelogFile: true

0 commit comments

Comments
 (0)