-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: BOUHOURS Antoine <[email protected]>
- Loading branch information
1 parent
54dcd00
commit 2f3b052
Showing
2 changed files
with
90 additions
and
18 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
83 changes: 83 additions & 0 deletions
83
...erver/src/main/resources/db/changelog/changesets/migrationExtensions_20240306T120000Z.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,83 @@ | ||
INSERT INTO extension (networkuuid, variantnum, equipmentid, equipmentType, name, value_) | ||
SELECT networkuuid, variantnum, id, 'BATTERY', 'activePowerControl', | ||
jsonb_set( | ||
COALESCE(activepowercontrol::jsonb, '{}'::jsonb), | ||
'{@type}', | ||
'"activePowerControl"'::jsonb | ||
) | ||
FROM battery | ||
WHERE activepowercontrol IS NOT NULL; | ||
|
||
INSERT INTO extension (networkuuid, variantnum, equipmentid, equipmentType, name, value_) | ||
SELECT networkuuid, variantnum, id, 'GENERATOR', 'activePowerControl', | ||
jsonb_set( | ||
COALESCE(activepowercontrol::jsonb, '{}'::jsonb), | ||
'{@type}', | ||
'"activePowerControl"'::jsonb | ||
) | ||
FROM generator | ||
WHERE activepowercontrol IS NOT NULL; | ||
|
||
INSERT INTO extension (networkuuid, variantnum, equipmentid, equipmentType, name, value_) | ||
SELECT networkuuid, variantnum, id, 'GENERATOR', 'startup', | ||
jsonb_set( | ||
COALESCE(generatorstartup::jsonb, '{}'::jsonb), | ||
'{@type}', | ||
'"startup"'::jsonb | ||
) | ||
FROM generator | ||
WHERE generatorstartup IS NOT NULL; | ||
|
||
INSERT INTO extension (networkuuid, variantnum, equipmentid, equipmentType, name, value_) | ||
SELECT networkuuid, variantnum, id, 'LINE', 'operatingStatus', | ||
jsonb_build_object( | ||
'@type', 'operatingStatus', | ||
'operatingStatus', operatingStatus::text | ||
) | ||
FROM line | ||
WHERE operatingStatus IS NOT NULL; | ||
|
||
INSERT INTO extension (networkuuid, variantnum, equipmentid, equipmentType, name, value_) | ||
SELECT networkuuid, variantnum, id, 'HVDC_LINE', 'operatingStatus', | ||
jsonb_build_object( | ||
'@type', 'operatingStatus', | ||
'operatingStatus', operatingStatus::text | ||
) | ||
FROM hvdcline | ||
WHERE operatingStatus IS NOT NULL; | ||
|
||
INSERT INTO extension (networkuuid, variantnum, equipmentid, equipmentType, name, value_) | ||
SELECT networkuuid, variantnum, id, 'TIE_LINE', 'operatingStatus', | ||
jsonb_build_object( | ||
'@type', 'operatingStatus', | ||
'operatingStatus', operatingStatus::text | ||
) | ||
FROM tieline | ||
WHERE operatingStatus IS NOT NULL; | ||
|
||
INSERT INTO extension (networkuuid, variantnum, equipmentid, equipmentType, name, value_) | ||
SELECT networkuuid, variantnum, id, 'DANGLING_LINE', 'operatingStatus', | ||
jsonb_build_object( | ||
'@type', 'operatingStatus', | ||
'operatingStatus', operatingStatus::text | ||
) | ||
FROM danglingline | ||
WHERE operatingStatus IS NOT NULL; | ||
|
||
INSERT INTO extension (networkuuid, variantnum, equipmentid, equipmentType, name, value_) | ||
SELECT networkuuid, variantnum, id, 'TWO_WINDINGS_TRANSFORMER', 'operatingStatus', | ||
jsonb_build_object( | ||
'@type', 'operatingStatus', | ||
'operatingStatus', operatingStatus::text | ||
) | ||
FROM twowindingstransformer | ||
WHERE operatingStatus IS NOT NULL; | ||
|
||
INSERT INTO extension (networkuuid, variantnum, equipmentid, equipmentType, name, value_) | ||
SELECT networkuuid, variantnum, id, 'THREE_WINDINGS_TRANSFORMER', 'operatingStatus', | ||
jsonb_build_object( | ||
'@type', 'operatingStatus', | ||
'operatingStatus', operatingStatus::text | ||
) | ||
FROM threewindingstransformer | ||
WHERE operatingStatus IS NOT NULL; |