-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace enums ordinal in database with their names
Signed-off-by: Seddik Yengui <[email protected]>
- Loading branch information
Seddik Yengui
committed
Sep 3, 2024
1 parent
7f95c07
commit 076eda6
Showing
4 changed files
with
37 additions
and
6 deletions.
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
31 changes: 31 additions & 0 deletions
31
src/main/resources/db/changelog/changesets/changelog_20240902T233408Z.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,31 @@ | ||
<?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="yenguised (generated)" id="1725320054035-1"> | ||
<addColumn tableName="identifier_list_filter"> | ||
<column name="equipment_type_new" type="varchar(255)" /> | ||
</addColumn> | ||
<sql> | ||
UPDATE identifier_list_filter | ||
SET equipment_type_new = CASE | ||
WHEN equipment_type = 0 THEN 'LINE' | ||
WHEN equipment_type = 1 THEN 'GENERATOR' | ||
WHEN equipment_type = 2 THEN 'LOAD' | ||
WHEN equipment_type = 3 THEN 'SHUNT_COMPENSATOR' | ||
WHEN equipment_type = 4 THEN 'STATIC_VAR_COMPENSATOR' | ||
WHEN equipment_type = 5 THEN 'BATTERY' | ||
WHEN equipment_type = 6 THEN 'BUS' | ||
WHEN equipment_type = 7 THEN 'BUSBAR_SECTION' | ||
WHEN equipment_type = 8 THEN 'DANGLING_LINE' | ||
WHEN equipment_type = 9 THEN 'LCC_CONVERTER_STATION' | ||
WHEN equipment_type = 10 THEN 'VSC_CONVERTER_STATION' | ||
WHEN equipment_type = 11 THEN 'TWO_WINDINGS_TRANSFORMER' | ||
WHEN equipment_type = 12 THEN 'THREE_WINDINGS_TRANSFORMER' | ||
WHEN equipment_type = 13 THEN 'HVDC_LINE' | ||
WHEN equipment_type = 14 THEN 'SUBSTATION' | ||
WHEN equipment_type = 15 THEN 'VOLTAGE_LEVEL' | ||
END; | ||
</sql> | ||
<dropColumn tableName="identifier_list_filter" columnName="equipment_type" /> | ||
<renameColumn tableName="identifier_list_filter" oldColumnName="equipment_type_new" newColumnName="equipment_type" /> | ||
</changeSet> | ||
</databaseChangeLog> |
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