 /* 
 -- renewable powerlants
 DROP TABLE IF EXISTS	supply.ego_dp_res_powerplant;
-CREATE TABLE 		supply.ego_dp_res_powerplant (
-	version 	text,
-	id bigint NOT NULL,
-	start_up_date timestamp without time zone,
-	electrical_capacity numeric,
-	generation_type text,
-	generation_subtype character varying,
-	thermal_capacity numeric,
-	city character varying,
-	postcode character varying,
-	address character varying,
-	lon numeric,
-	lat numeric,
-	gps_accuracy character varying,
-	validation character varying,
-	notification_reason character varying,
-	eeg_id character varying,
-	tso double precision,
-	tso_eic character varying,
-	dso_id character varying,
-	dso character varying,
-	voltage_level_var character varying,
-	network_node character varying,
-	power_plant_id character varying,
-	source character varying,
-	comment character varying,
-	geom geometry(Point,4326),
-	subst_id bigint,
-	otg_id bigint,
-	un_id bigint,
-	voltage_level smallint,
-	la_id integer,
-	mvlv_subst_id integer,
-	w_id bigint,
-	rea_sort integer,
-	rea_flag character varying,
-	rea_geom_line geometry(LineString,3035),
-	rea_geom_new geometry(Point,3035),
-	CONSTRAINT ego_dp_res_powerplant_pkey PRIMARY KEY (version,id) );
+CREATE TABLE		supply.ego_dp_res_powerplant
+(
+  version text NOT NULL,
+  id bigint NOT NULL,
+  start_up_date timestamp without time zone,
+  electrical_capacity numeric,
+  generation_type text,
+  generation_subtype character varying,
+  thermal_capacity numeric,
+  city character varying,
+  postcode character varying,
+  address character varying,
+  lon numeric,
+  lat numeric,
+  gps_accuracy character varying,
+  validation character varying,
+  notification_reason character varying,
+  eeg_id character varying,
+  tso double precision,
+  tso_eic character varying,
+  dso_id character varying,
+  dso character varying,
+  voltage_level_var character varying,
+  network_node character varying,
+  power_plant_id character varying,
+  source character varying,
+  comment character varying,
+  geom geometry(Point,4326),
+  subst_id bigint,
+  otg_id bigint,
+  un_id bigint,
+  voltage_level smallint,
+  la_id integer,
+  mvlv_subst_id integer,
+  rea_sort integer,
+  rea_flag character varying,
+  rea_geom_line geometry(LineString,3035),
+  rea_geom_new geometry(Point,3035),
+  preversion text,
+  flag character varying,
+  scenario character varying NOT NULL DEFAULT 'none'::character varying,
+  nuts character varying,
+  w_id bigint,
+  CONSTRAINT ego_dp_res_powerplant_pkey PRIMARY KEY (version, scenario, id) 
+  );
   
 --FK
 ALTER TABLE supply.ego_dp_res_powerplant

/* 
-- conventinal powerlants
DROP TABLE IF EXISTS	supply.ego_dp_conv_powerplant;
CREATE TABLE 		supply.ego_dp_conv_powerplant (
	version 	text,
	gid integer NOT NULL,
	bnetza_id text,
	company text,
	name text,
	postcode text,
	city text,
	street text,
	state text,
	block text,
	commissioned_original text,
	commissioned double precision,
	retrofit double precision,
	shutdown double precision,
	status text,
	fuel text,
	technology text,
	type text,
	eeg text,
	chp text,
	capacity double precision,
	capacity_uba double precision,
	chp_capacity_uba double precision,
	efficiency_data double precision,
	efficiency_estimate double precision,
	network_node text,
	voltage text,
	network_operator text,
	name_uba text,
	lat double precision,
	lon double precision,
	comment text,
	geom geometry(Point,4326),
	voltage_level smallint,
	subst_id bigint,
	otg_id bigint,
	un_id bigint,
	CONSTRAINT ego_dp_conv_powerplant_pkey PRIMARY KEY (version,gid) );
  
--FK
ALTER TABLE supply.ego_dp_conv_powerplant

SELECT obj_description('grid.ego_line_expansion_costs' ::regclass) ::json;

-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
SELECT scenario_log('eGo_DP', 'v0.4.0','result','grid','ego_line_expansion_costs','ego_dp_structure_versioning.sql','hv pf line expansion costs');
