 ALTER TABLE model_draft.renpass_gis_economic_sink OWNER TO oeuser;
 GRANT ALL ON SEQUENCE model_draft.renpass_gis_economic_sink_id_seq TO oeuser;
 
-ALTER TABLE model_draft.renpass_gis_results OWNER TO oeuser;
-GRANT ALL ON SEQUENCE model_draft.renpass_gis_results_id_seq TO oeuser;
-
-ALTER TABLE model_draft.renpass_gis_scenario OWNER TO oeuser;
-GRANT ALL ON SEQUENCE model_draft.renpass_gis_scenario_id_seq TO oeuser;
+ALTER TABLE model_draft.renpass_gis_scenario_results OWNER TO oeuser;
+GRANT ALL ON SEQUENCE model_draft.renpass_gis_scenario_results_id_seq TO oeuser;
+
+ALTER TABLE model_draft.renpass_gis_economic_scenario OWNER TO oeuser;
+GRANT ALL ON SEQUENCE model_draft.renpass_gis_economic_scenario_id_seq TO oeuser;
 
 ALTER TABLE model_draft.renpass_gis_economic_linear_transformer OWNER TO oeuser;
 GRANT ALL ON SEQUENCE model_draft.renpass_gis_economic_linear_transformer_id_seq TO oeuser;

﻿/* 
renpass_gis schema


*/


-- Sequence: model_draft.renpass_gis_results_id_seq
-- DROP SEQUENCE model_draft.renpass_gis_results_id_seq;

CREATE SEQUENCE model_draft.renpass_gis_results_id_seq START 1;

-- Sequence: model_draft.renpass_gis_scenario_id_seq
-- DROP SEQUENCE model_draft.renpass_gis_scenario_id_seq;

CREATE SEQUENCE model_draft.renpass_gis_scenario_id_seq START 1;

-- Sequence: model_draft.renpass_gis_economic_storage_id_seq
-- DROP SEQUENCE model_draft.renpass_gis_economic_storage_id_seq;

CREATE SEQUENCE model_draft.renpass_gis_economic_storage_id_seq START 1;

-- Sequence: model_draft.renpass_gis_economic_linear_transformer_id_seq
-- DROP SEQUENCE model_draft.renpass_gis_economic_linear_transformer_id_seq;

CREATE SEQUENCE model_draft.renpass_gis_economic_linear_transformer_id_seq START 1;

-- Sequence: model_draft.renpass_gis_economic_sink_id_seq
-- DROP SEQUENCE model_draft.renpass_gis_economic_sink_id_seq;
CREATE SEQUENCE model_draft.renpass_gis_economic_sink_id_seq START 1;

-- Sequence: model_draft.renpass_gis_economic_source_id_seq
-- DROP SEQUENCE model_draft.renpass_gis_economic_source_id_seq;
CREATE SEQUENCE model_draft.renpass_gis_economic_source_id_seq START 1;


-- Table: model_draft.economic_weatherpoint

-- DROP TABLE model_draft.economic_weatherpoint;

CREATE TABLE model_draft.economic_weatherpoint
(
  gid serial NOT NULL,
  year integer,
  geom geometry(Point,4326),
  CONSTRAINT economic_weatherpoint_pkey PRIMARY KEY (gid)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE model_draft.economic_weatherpoint
  OWNER TO oeuser;
GRANT ALL ON TABLE model_draft.economic_weatherpoint TO oeuser;

-- Index: model_draft.idx_economic_weatherpoint_geom

-- DROP INDEX model_draft.idx_economic_weatherpoint_geom;

CREATE INDEX idx_economic_weatherpoint_geom
  ON model_draft.economic_weatherpoint
  USING gist
  (geom);

COMMENT ON TABLE model_draft.economic_weatherpoint
  IS '{
"Name": "weather point location",
"Source": [{
                  "Name": "",
                  "URL":  "" }],
"Reference date": "",
"Date of collection": "",
"Original file": "",
"Spatial resolution": ["Germany"],
"Description": [""],
"Column": [
                   {"Name":"gid", "Description":"Unique identifier", "Unit":""},
                   {"Name":"year", "Description":"Reference year", "Unit":""},
                   {"Name":"geom", "Description":"Point geometry", "Unit":""},
],
"Changes":[
                   {"Name": "Martin Söthe",
                    "Mail": "martin.soethe@uni-flensburg.de",
                    "Date":  "26.10.2016",
                    "Comment": "Created an empty table." }],
"ToDo": ["Determine license. Add data."],
"Licence": [""],
"Instructions for proper use": [""],
"Label": [""]
}''';



     
-- Table: model_draft.renpass_gis_economic_source
-- DROP TABLE model_draft.renpass_gis_economic_source;

  IS '{
"Name": "eGo renpassG!S storage",
"Source": [{
                  "Name": "renpassG!S",
                  "URL":  "https://github.com/znes/renpass_gis" },
		{"Name": "Open Energy Modelling Framework",
		 "URL": "https://github.com/oemof"}],
