Skip to content

Commit 21dab4a

Browse files
author
IlkaCu
authored
remove and create column otg_id
1 parent 2d9abac commit 21dab4a

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

dataprocessing/sql_snippets/ego_dp_powerflow_assignment_otgid.sql

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ __author__ = "IlkaCu"
1111
*/
1212

1313
-- Set column otg_id to NULL
14-
UPDATE model_draft.ego_dp_supply_res_powerplant
15-
SET otg_id = NULL;
14+
ALTER TABLE model_draft.ego_dp_supply_res_powerplant
15+
DROP COLUMN otg_id;
16+
17+
ALTER TABLE model_draft.ego_dp_supply_res_powerplant
18+
ADD COLUMN otg_id;
1619

1720
-- Insert otg_id of bus for res pp
1821
UPDATE model_draft.ego_dp_supply_res_powerplant a
@@ -27,8 +30,11 @@ UPDATE model_draft.ego_dp_supply_res_powerplant a
2730

2831

2932
-- Set column otg_id to NULL
30-
UPDATE model_draft.ego_dp_supply_conv_powerplant
31-
SET otg_id = NULL;
33+
ALTER TABLE model_draft.ego_dp_supply_conv_powerplant
34+
DROP COLUMN otg_id;
35+
36+
ALTER TABLE model_draft.ego_dp_supply_conv_powerplant
37+
ADD COLUMN otg_id;
3238

3339
-- Insert otg_id of bus for conv pp
3440
UPDATE model_draft.ego_dp_supply_conv_powerplant a

0 commit comments

Comments
 (0)