Skip to content

Commit

Permalink
refac: Update metering point type and constraints (#3068)
Browse files Browse the repository at this point in the history
* Rename effect settlement to capacity settlement in python

* Rename to capacity settlement in dotnet

* Revert "Rename to capacity settlement in dotnet"

This reverts commit 8911013.

* dotnet

* Create 2024120161500_alter_tables__metering_point_type_constraints.sql

* Update 202412161500_alter_tables__metering_point_type_constraints.sql

* Update MeteringPointTypeMapperTests.cs

* .

* .

* refac: Update metering point type and constraints
  • Loading branch information
johevemi authored Dec 18, 2024
1 parent 5099f93 commit 147ff64
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
UPDATE {CATALOG_NAME}.{WHOLESALE_BASIS_DATA_INTERNAL_DATABASE_NAME}.time_series_points
SET metering_point_type = 'capacity_settlement'
WHERE metering_point_type = 'effect_settlement';
GO

UPDATE {CATALOG_NAME}.{WHOLESALE_RESULTS_INTERNAL_DATABASE_NAME}.amounts_per_charge
SET metering_point_type = 'capacity_settlement'
WHERE metering_point_type = 'effect_settlement';
GO

UPDATE {CATALOG_NAME}.{WHOLESALE_BASIS_DATA_INTERNAL_DATABASE_NAME}.metering_point_periods
SET metering_point_type = 'capacity_settlement'
WHERE metering_point_type = 'effect_settlement';
GO
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ALTER TABLE {CATALOG_NAME}.{WHOLESALE_BASIS_DATA_INTERNAL_DATABASE_NAME}.time_series_points
DROP CONSTRAINT IF EXISTS metering_point_type_chk
GO

ALTER TABLE {CATALOG_NAME}.{WHOLESALE_BASIS_DATA_INTERNAL_DATABASE_NAME}.time_series_points
ADD CONSTRAINT metering_point_type_chk
CHECK (metering_point_type IN ( 'production' , 'consumption' , 'exchange' , 've_production' , 'net_production' , 'supply_to_grid' , 'consumption_from_grid' , 'wholesale_services_information' , 'own_production' , 'net_from_grid' , 'net_to_grid' , 'total_consumption' , 'electrical_heating' , 'net_consumption' , 'capacity_settlement' ))
GO

ALTER TABLE {CATALOG_NAME}.{WHOLESALE_RESULTS_INTERNAL_DATABASE_NAME}.amounts_per_charge
DROP CONSTRAINT IF EXISTS metering_point_type_chk
GO

ALTER TABLE {CATALOG_NAME}.{WHOLESALE_RESULTS_INTERNAL_DATABASE_NAME}.amounts_per_charge
ADD CONSTRAINT metering_point_type_chk
CHECK (metering_point_type IN ( 'production' , 'consumption' , 'exchange' , 've_production' , 'net_production' , 'supply_to_grid' , 'consumption_from_grid' , 'wholesale_services_information' , 'own_production' , 'net_from_grid' , 'net_to_grid' , 'total_consumption' , 'electrical_heating' , 'net_consumption' , 'capacity_settlement' ))
GO

ALTER TABLE {CATALOG_NAME}.{WHOLESALE_BASIS_DATA_INTERNAL_DATABASE_NAME}.metering_point_periods
DROP CONSTRAINT IF EXISTS metering_point_type_chk
GO

ALTER TABLE {CATALOG_NAME}.{WHOLESALE_BASIS_DATA_INTERNAL_DATABASE_NAME}.metering_point_periods
ADD CONSTRAINT metering_point_type_chk
CHECK (metering_point_type IN ( 'production' , 'consumption' , 'exchange' , 've_production' , 'net_production' , 'supply_to_grid' , 'consumption_from_grid' , 'wholesale_services_information' , 'own_production' , 'net_from_grid' , 'net_to_grid' , 'total_consumption' , 'electrical_heating' , 'net_consumption' , 'capacity_settlement' ))
GO

0 comments on commit 147ff64

Please sign in to comment.