Skip to content
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

change type of equipment_type in identifier_list_filter to varchar #128

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">

<changeSet id="1725955832122-1" author="lesoteti (generated)">
<sqlFile
encoding="UTF-8"
path="migrationListFilterType_20240911T120841Z.sql"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
<rollback>
<sqlFile
encoding="UTF-8"
path="migrationListFilterTypeRollBack_20240911T120841Z.sql"
relativeToChangelogFile="true"
splitStatements="true"
stripComments="true"/>
</rollback>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ALTER TABLE identifier_list_filter ADD COLUMN equipment_type_temporary integer;
UPDATE identifier_list_filter SET equipment_type_temporary = 0 WHERE equipment_type ='LINE';
UPDATE identifier_list_filter SET equipment_type_temporary = 1 WHERE equipment_type ='GENERATOR';
UPDATE identifier_list_filter SET equipment_type_temporary = 2 WHERE equipment_type ='LOAD';
UPDATE identifier_list_filter SET equipment_type_temporary = 3 WHERE equipment_type ='SHUNT_COMPENSATOR';
UPDATE identifier_list_filter SET equipment_type_temporary = 4 WHERE equipment_type ='STATIC_VAR_COMPENSATOR';
UPDATE identifier_list_filter SET equipment_type_temporary = 5 WHERE equipment_type ='BATTERY';
UPDATE identifier_list_filter SET equipment_type_temporary = 6 WHERE equipment_type ='BUS';
UPDATE identifier_list_filter SET equipment_type_temporary = 7 WHERE equipment_type ='BUSBAR_SECTION';
UPDATE identifier_list_filter SET equipment_type_temporary = 8 WHERE equipment_type ='DANGLING_LINE';
UPDATE identifier_list_filter SET equipment_type_temporary = 9 WHERE equipment_type ='LCC_CONVERTER_STATION';
UPDATE identifier_list_filter SET equipment_type_temporary = 10 WHERE equipment_type = 'VSC_CONVERTER_STATION';
UPDATE identifier_list_filter SET equipment_type_temporary = 11 WHERE equipment_type = 'TWO_WINDINGS_TRANSFORMER';
UPDATE identifier_list_filter SET equipment_type_temporary = 12 WHERE equipment_type = 'THREE_WINDINGS_TRANSFORMER';
UPDATE identifier_list_filter SET equipment_type_temporary = 13 WHERE equipment_type = 'HVDC_LINE';
UPDATE identifier_list_filter SET equipment_type_temporary = 14 WHERE equipment_type = 'SUBSTATION';
UPDATE identifier_list_filter SET equipment_type_temporary = 15 WHERE equipment_type = 'VOLTAGE_LEVEL';
ALTER TABLE identifier_list_filter DROP COLUMN equipment_type;
ALTER TABLE identifier_list_filter RENAME COLUMN equipment_type_temporary TO equipment_type;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ALTER TABLE identifier_list_filter ADD COLUMN equipment_type_temporary varchar;
UPDATE identifier_list_filter SET equipment_type_temporary = 'LINE' WHERE equipment_type = 0;
UPDATE identifier_list_filter SET equipment_type_temporary = 'GENERATOR' WHERE equipment_type = 1;
UPDATE identifier_list_filter SET equipment_type_temporary = 'LOAD' WHERE equipment_type = 2;
UPDATE identifier_list_filter SET equipment_type_temporary = 'SHUNT_COMPENSATOR' WHERE equipment_type = 3;
UPDATE identifier_list_filter SET equipment_type_temporary = 'STATIC_VAR_COMPENSATOR' WHERE equipment_type = 4;
UPDATE identifier_list_filter SET equipment_type_temporary = 'BATTERY' WHERE equipment_type = 5;
UPDATE identifier_list_filter SET equipment_type_temporary = 'BUS' WHERE equipment_type = 6;
UPDATE identifier_list_filter SET equipment_type_temporary = 'BUSBAR_SECTION' WHERE equipment_type = 7;
UPDATE identifier_list_filter SET equipment_type_temporary = 'DANGLING_LINE' WHERE equipment_type = 8;
UPDATE identifier_list_filter SET equipment_type_temporary = 'LCC_CONVERTER_STATION' WHERE equipment_type = 9;
UPDATE identifier_list_filter SET equipment_type_temporary = 'VSC_CONVERTER_STATION' WHERE equipment_type = 10;
UPDATE identifier_list_filter SET equipment_type_temporary = 'TWO_WINDINGS_TRANSFORMER' WHERE equipment_type = 11;
UPDATE identifier_list_filter SET equipment_type_temporary = 'THREE_WINDINGS_TRANSFORMER' WHERE equipment_type = 12;
UPDATE identifier_list_filter SET equipment_type_temporary = 'HVDC_LINE' WHERE equipment_type = 13;
UPDATE identifier_list_filter SET equipment_type_temporary = 'SUBSTATION' WHERE equipment_type = 14;
UPDATE identifier_list_filter SET equipment_type_temporary = 'VOLTAGE_LEVEL' WHERE equipment_type = 15;
ALTER TABLE identifier_list_filter DROP COLUMN equipment_type;
ALTER TABLE identifier_list_filter RENAME COLUMN equipment_type_temporary TO equipment_type;
3 changes: 3 additions & 0 deletions src/main/resources/db/changelog/db.changelog-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ databaseChangeLog:
- include:
file: changesets/changelog_20240902T233408Z.xml
relativeToChangelogFile: true
- include:
file: changesets/changelog_20240911T162600Z.xml
relativeToChangelogFile: true
Loading