-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor tabular modification #412
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bf120a0
refactor tabular modification (todo modificationType column drop and …
dbraquart b984714
Merge remote-tracking branch 'origin/main' into refactor-tabular-modi…
dbraquart c494e22
update after merge
dbraquart 83f827c
add migration sql file
dbraquart fad6a29
rename tabularModificationType
dbraquart 9a9ef14
Merge branch 'main' into refactor-tabular-modification
dbraquart e5ed79e
review remark: use ModificationType rather than IdentifiableType
dbraquart 9cb42a2
Merge remote-tracking branch 'origin/main' into refactor-tabular-modi…
dbraquart 23ad0d3
fix after merge with conflicts
dbraquart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/resources/db/changelog/changesets/changelog_20240103T175012Z.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.1" encoding="UTF-8" standalone="no"?> | ||
<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"> | ||
<changeSet author="braquartdav (generated)" id="1704304253203-29"> | ||
<addColumn tableName="tabular_modification"> | ||
<column name="equipment_type" type="varchar(255)"/> | ||
</addColumn> | ||
</changeSet> | ||
<changeSet author="braquartdav" id="migrationTabularModificationType-20240103T175012Z-1"> | ||
<sqlFile | ||
encoding="UTF-8" | ||
path="migrationTabularModificationType_20240103T175012Z.sql" | ||
relativeToChangelogFile="true" | ||
splitStatements="true" | ||
stripComments="true"/> | ||
</changeSet> | ||
<changeSet author="braquartdav (generated)" id="1704304253203-47"> | ||
<dropColumn columnName="modification_type" tableName="tabular_modification"/> | ||
</changeSet> | ||
</databaseChangeLog> |
22 changes: 22 additions & 0 deletions
22
...n/resources/db/changelog/changesets/migrationTabularModificationType_20240103T175012Z.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
update tabular_modification set equipment_type = | ||
(case | ||
when modification_type = 'BATTERY_MODIFICATION' then 'BATTERY' | ||
when modification_type = 'GENERATOR_MODIFICATION' then 'GENERATOR' | ||
when modification_type = 'LINE_MODIFICATION' then 'LINE' | ||
when modification_type = 'LOAD_MODIFICATION' then 'LOAD' | ||
when modification_type = 'SUBSTATION_MODIFICATION' then 'SUBSTATION' | ||
when modification_type = 'TWO_WINDINGS_TRANSFORMER_MODIFICATION' then 'TWO_WINDINGS_TRANSFORMER' | ||
when modification_type = 'VOLTAGE_LEVEL_MODIFICATION' then 'VOLTAGE_LEVEL' | ||
end) | ||
where id = id; | ||
update modification set message_values = | ||
(case | ||
when message_values = '{"tabularModificationType":"BATTERY_MODIFICATION"}' then '{"tabularEquipmentType":"BATTERY"}' | ||
when message_values = '{"tabularModificationType":"GENERATOR_MODIFICATION"}' then '{"tabularEquipmentType":"GENERATOR"}' | ||
when message_values = '{"tabularModificationType":"LINE_MODIFICATION"}' then '{"tabularEquipmentType":"LINE"}' | ||
when message_values = '{"tabularModificationType":"LOAD_MODIFICATION"}' then '{"tabularEquipmentType":"LOAD"}' | ||
when message_values = '{"tabularModificationType":"SUBSTATION_MODIFICATION"}' then '{"tabularEquipmentType":"SUBSTATION"}' | ||
when message_values = '{"tabularModificationType":"TWO_WINDINGS_TRANSFORMER_MODIFICATION"}' then '{"tabularEquipmentType":"TWO_WINDINGS_TRANSFORMER"}' | ||
when message_values = '{"tabularModificationType":"VOLTAGE_LEVEL_MODIFICATION"}' then '{"tabularEquipmentType":"VOLTAGE_LEVEL"}' | ||
end) | ||
where type = 'TABULAR_MODIFICATION' and id = id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not enough. We can have here types like GENERATOR_MODIFICATION, GENERATOR_CREATION or EQUIPMENT_DELETION
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using ModificationType enum would be more appropriate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
ModificationType
represente all modification types of networkWe need only injection modificatio/creation/deletion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
operationType { MODIFICATION, CREATION, DELETION } ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to use 2 fields : IdentifiableType equipmentType + OperationType operationType ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last decision: we use ModificationType enum. No data migration. Same Front-end.