Skip to content

Commit dcd1ad8

Browse files
committed
Add comments to sql
1 parent cfa529b commit dcd1ad8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sql/create-constraints.sql

+6
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ create sequence id start 1
200200

201201
create table cons_min_outgoing_flow_for_transport_flows_without_unit_commitment as
202202

203+
-- We want to check if the outgoing flows of an asset have transport flows
204+
-- This information is gathered from the flow table
205+
-- COALESCE is used to handle the case where there are no outgoing flows
203206
with transport_flow_info as (
204207
select
205208
asset.asset,
@@ -221,6 +224,7 @@ from
221224
where
222225
asset.type in ('producer', 'storage', 'conversion')
223226
and transport_flow_info.outgoing_flows_have_transport_flows
227+
-- Assets with unit commitment already have a minimum outgoing flow constraints
224228
and not asset.unit_commitment
225229
;
226230

@@ -232,6 +236,8 @@ create sequence id start 1
232236

233237
create table cons_min_incoming_flow_for_transport_flows as
234238

239+
-- Similar to the previous query, but for incoming flows
240+
-- Also for assets with unit commitment
235241
with transport_flow_info as (
236242
select
237243
asset.asset,

0 commit comments

Comments
 (0)