Commit f623444b authored by Rushikesh Padsala's avatar Rushikesh Padsala
Browse files

Updated DDLs for FWE ADE

parent 9d0e04a0
Pipeline #1758 passed with stage
in 6 seconds
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:56:23
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create tables **************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEA_areasurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEA_areasurvey
(
id INTEGER NOT NULL,
buildingfootrpintarea NUMBER,
buildingfootrpintarea_uom VARCHAR2(1000),
fwearea_consistsoffwesurv_id INTEGER,
objectclass_id INTEGER,
openplotarea NUMBER,
openplotarea_uom VARCHAR2(1000),
population INTEGER,
settlementarea NUMBER,
settlementarea_uom VARCHAR2(1000),
surfacearea NUMBER,
surfacearea_uom VARCHAR2(1000),
surveydescription VARCHAR2(1000),
surveyyear INTEGER,
surveyyearversion NUMBER,
trafficarea NUMBER,
trafficarea_uom VARCHAR2(1000),
vegetationarea NUMBER,
vegetationarea_uom VARCHAR2(1000),
waterbodyarea NUMBER,
waterbodyarea_uom VARCHAR2(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEA_energysurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEA_energysurvey
(
id INTEGER NOT NULL,
areasurvey_energysurvey_id INTEGER,
biomasselectricitypotential NUMBER,
biomasselectricitypotentialu VARCHAR2(1000),
biomassprimaryenergypotent_1 VARCHAR2(1000),
biomassprimaryenergypotentia NUMBER,
biomassthermalpotential NUMBER,
biomassthermalpotentialunit VARCHAR2(1000),
electricitypotentialfrompv_1 VARCHAR2(1000),
electricitypotentialfrompvbu NUMBER,
residentialelectricitydema_1 VARCHAR2(1000),
residentialelectricitydemand NUMBER,
spacecoolingdemand NUMBER,
spacecoolingdemandunit VARCHAR2(1000),
spaceheatingdemand NUMBER,
spaceheatingdemandunit VARCHAR2(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEA_foodsurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEA_foodsurvey
(
id INTEGER NOT NULL,
areasurvey_foodsurvey_id INTEGER,
foodcategory VARCHAR2(1000),
foodcategory_codespace VARCHAR2(1000),
foodconsumption NUMBER,
foodconsumptionunit VARCHAR2(1000),
fooddemand NUMBER,
fooddemandunit VARCHAR2(1000),
foodproduction NUMBER,
foodproductionenergydemand NUMBER,
foodproductionenergydemandun VARCHAR2(1000),
foodproductionunit VARCHAR2(1000),
foodproductionwaterdemand NUMBER,
foodproductionwaterdemanduni VARCHAR2(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEA_fwearea
-- --------------------------------------------------------------------
CREATE TABLE FWEA_fwearea
(
id INTEGER NOT NULL,
fweareaname VARCHAR2(1000),
fwesystemname VARCHAR2(1000),
lod0multisurface_id INTEGER,
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEA_watersurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEA_watersurvey
(
id INTEGER NOT NULL,
areasurvey_watersurvey_id INTEGER,
domestichotwaterdemand NUMBER,
domestichotwaterdemandunit VARCHAR2(1000),
domesticsolidwaste NUMBER,
domesticsolidwasteunit VARCHAR2(1000),
domesticwaterdemand NUMBER,
domesticwaterdemandunit VARCHAR2(1000),
domesticwaterwaste NUMBER,
domesticwaterwasteunit VARCHAR2(1000),
totaldomesticwaste NUMBER,
totaldomesticwasteenergypo_1 VARCHAR2(1000),
totaldomesticwasteenergypote NUMBER,
totaldomesticwasteunit VARCHAR2(1000),
PRIMARY KEY (id)
);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create foreign keys ********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEA_areasurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_areasurvey ADD CONSTRAINT FWEA_areasurvey_fk FOREIGN KEY (id)
REFERENCES cityobject (id);
ALTER TABLE FWEA_areasurvey ADD CONSTRAINT FWEA_areasurve_objectcl_fk FOREIGN KEY (objectclass_id)
REFERENCES objectclass (id);
ALTER TABLE FWEA_areasurvey ADD CONSTRAINT FWEA_areasu_fwear_consi_fk FOREIGN KEY (fwearea_consistsoffwesurv_id)
REFERENCES FWEA_fwearea (id)
ON DELETE SET NULL;
-- --------------------------------------------------------------------
-- FWEA_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_energysurvey ADD CONSTRAINT FWEA_energysurvey_fk FOREIGN KEY (id)
REFERENCES FWEA_areasurvey (id);
ALTER TABLE FWEA_energysurvey ADD CONSTRAINT FWEA_energy_areas_energ_fk FOREIGN KEY (areasurvey_energysurvey_id)
REFERENCES FWEA_areasurvey (id);
-- --------------------------------------------------------------------
-- FWEA_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_foodsurvey ADD CONSTRAINT FWEA_foodsurvey_fk FOREIGN KEY (id)
REFERENCES FWEA_areasurvey (id);
ALTER TABLE FWEA_foodsurvey ADD CONSTRAINT FWEA_foodsu_areas_foods_fk FOREIGN KEY (areasurvey_foodsurvey_id)
REFERENCES FWEA_areasurvey (id);
-- --------------------------------------------------------------------
-- FWEA_fwearea
-- --------------------------------------------------------------------
ALTER TABLE FWEA_fwearea ADD CONSTRAINT FWEA_fwearea_fk FOREIGN KEY (id)
REFERENCES cityobject (id);
ALTER TABLE FWEA_fwearea ADD CONSTRAINT FWEA_fwearea_lod0multis_fk FOREIGN KEY (lod0multisurface_id)
REFERENCES surface_geometry (id);
-- --------------------------------------------------------------------
-- FWEA_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_watersurvey ADD CONSTRAINT FWEA_watersurvey_fk FOREIGN KEY (id)
REFERENCES FWEA_areasurvey (id);
ALTER TABLE FWEA_watersurvey ADD CONSTRAINT FWEA_waters_areas_water_fk FOREIGN KEY (areasurvey_watersurvey_id)
REFERENCES FWEA_areasurvey (id);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Indexes *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEA_areasurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEA_areas_fwear_consi_fkx ON FWEA_areasurvey (fwearea_consistsoffwesurv_id);
CREATE INDEX FWEA_areasurv_objectcl_fkx ON FWEA_areasurvey (objectclass_id);
-- --------------------------------------------------------------------
-- FWEA_energysurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEA_energ_areas_energ_fkx ON FWEA_energysurvey (areasurvey_energysurvey_id);
-- --------------------------------------------------------------------
-- FWEA_foodsurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEA_foods_areas_foods_fkx ON FWEA_foodsurvey (areasurvey_foodsurvey_id);
-- --------------------------------------------------------------------
-- FWEA_fwearea
-- --------------------------------------------------------------------
CREATE INDEX FWEA_fwearea_lod0multi_fkx ON FWEA_fwearea (lod0multisurface_id);
-- --------------------------------------------------------------------
-- FWEA_watersurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEA_water_areas_water_fkx ON FWEA_watersurvey (areasurvey_watersurvey_id);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Sequences ***********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:56:23
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Disable Versioning *********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exec DBMS_WM.DisableVersioning('FWEA_areasurvey,FWEA_energysurvey,FWEA_foodsurvey,FWEA_fwearea,FWEA_watersurvey,',true, true);
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:56:23
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop foreign keys **********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEA_areasurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_areasurvey
DROP CONSTRAINT FWEA_areasurvey_fk;
ALTER TABLE FWEA_areasurvey
DROP CONSTRAINT FWEA_areasurve_objectcl_fk;
ALTER TABLE FWEA_areasurvey
DROP CONSTRAINT FWEA_areasu_fwear_consi_fk;
-- --------------------------------------------------------------------
-- FWEA_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_energysurvey
DROP CONSTRAINT FWEA_energysurvey_fk;
ALTER TABLE FWEA_energysurvey
DROP CONSTRAINT FWEA_energy_areas_energ_fk;
-- --------------------------------------------------------------------
-- FWEA_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_foodsurvey
DROP CONSTRAINT FWEA_foodsurvey_fk;
ALTER TABLE FWEA_foodsurvey
DROP CONSTRAINT FWEA_foodsu_areas_foods_fk;
-- --------------------------------------------------------------------
-- FWEA_fwearea
-- --------------------------------------------------------------------
ALTER TABLE FWEA_fwearea
DROP CONSTRAINT FWEA_fwearea_fk;
ALTER TABLE FWEA_fwearea
DROP CONSTRAINT FWEA_fwearea_lod0multis_fk;
-- --------------------------------------------------------------------
-- FWEA_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_watersurvey
DROP CONSTRAINT FWEA_watersurvey_fk;
ALTER TABLE FWEA_watersurvey
DROP CONSTRAINT FWEA_waters_areas_water_fk;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop tables ***************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEA_areasurvey
-- --------------------------------------------------------------------
DROP TABLE FWEA_areasurvey;
-- --------------------------------------------------------------------
-- FWEA_energysurvey
-- --------------------------------------------------------------------
DROP TABLE FWEA_energysurvey;
-- --------------------------------------------------------------------
-- FWEA_foodsurvey
-- --------------------------------------------------------------------
DROP TABLE FWEA_foodsurvey;
-- --------------------------------------------------------------------
-- FWEA_fwearea
-- --------------------------------------------------------------------
DROP TABLE FWEA_fwearea;
-- --------------------------------------------------------------------
-- FWEA_watersurvey
-- --------------------------------------------------------------------
DROP TABLE FWEA_watersurvey;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop Sequences *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PURGE RECYCLEBIN;
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:56:23
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Enable Versioning **********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exec DBMS_WM.EnableVersioning('FWEA_areasurvey,FWEA_energysurvey,FWEA_foodsurvey,FWEA_fwearea,FWEA_watersurvey,','VIEW_WO_OVERWRITE');
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:56:23
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create tables **************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEA_areasurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEA_areasurvey
(
id INTEGER NOT NULL,
buildingfootrpintarea NUMERIC,
buildingfootrpintarea_uom VARCHAR(1000),
fwearea_consistsoffwesurv_id INTEGER,
objectclass_id INTEGER,
openplotarea NUMERIC,
openplotarea_uom VARCHAR(1000),
population INTEGER,
settlementarea NUMERIC,
settlementarea_uom VARCHAR(1000),
surfacearea NUMERIC,
surfacearea_uom VARCHAR(1000),
surveydescription VARCHAR(1000),
surveyyear INTEGER,
surveyyearversion NUMERIC,
trafficarea NUMERIC,
trafficarea_uom VARCHAR(1000),
vegetationarea NUMERIC,
vegetationarea_uom VARCHAR(1000),
waterbodyarea NUMERIC,
waterbodyarea_uom VARCHAR(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEA_energysurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEA_energysurvey
(
id INTEGER NOT NULL,
areasurvey_energysurvey_id INTEGER,
biomasselectricitypotential NUMERIC,
biomasselectricitypotentialu VARCHAR(1000),
biomassprimaryenergypotent_1 VARCHAR(1000),
biomassprimaryenergypotentia NUMERIC,
biomassthermalpotential NUMERIC,
biomassthermalpotentialunit VARCHAR(1000),
electricitypotentialfrompv_1 VARCHAR(1000),
electricitypotentialfrompvbu NUMERIC,
residentialelectricitydema_1 VARCHAR(1000),
residentialelectricitydemand NUMERIC,
spacecoolingdemand NUMERIC,
spacecoolingdemandunit VARCHAR(1000),
spaceheatingdemand NUMERIC,
spaceheatingdemandunit VARCHAR(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEA_foodsurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEA_foodsurvey
(
id INTEGER NOT NULL,
areasurvey_foodsurvey_id INTEGER,
foodcategory VARCHAR(1000),
foodcategory_codespace VARCHAR(1000),
foodconsumption NUMERIC,
foodconsumptionunit VARCHAR(1000),
fooddemand NUMERIC,
fooddemandunit VARCHAR(1000),
foodproduction NUMERIC,
foodproductionenergydemand NUMERIC,
foodproductionenergydemandun VARCHAR(1000),
foodproductionunit VARCHAR(1000),
foodproductionwaterdemand NUMERIC,
foodproductionwaterdemanduni VARCHAR(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEA_fwearea
-- --------------------------------------------------------------------
CREATE TABLE FWEA_fwearea
(
id INTEGER NOT NULL,
fweareaname VARCHAR(1000),
fwesystemname VARCHAR(1000),
lod0multisurface_id INTEGER,
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEA_watersurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEA_watersurvey
(
id INTEGER NOT NULL,
areasurvey_watersurvey_id INTEGER,
domestichotwaterdemand NUMERIC,
domestichotwaterdemandunit VARCHAR(1000),
domesticsolidwaste NUMERIC,
domesticsolidwasteunit VARCHAR(1000),
domesticwaterdemand NUMERIC,
domesticwaterdemandunit VARCHAR(1000),
domesticwaterwaste NUMERIC,
domesticwaterwasteunit VARCHAR(1000),
totaldomesticwaste NUMERIC,
totaldomesticwasteenergypo_1 VARCHAR(1000),
totaldomesticwasteenergypote NUMERIC,
totaldomesticwasteunit VARCHAR(1000),
PRIMARY KEY (id)
);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create foreign keys ********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEA_areasurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_areasurvey ADD CONSTRAINT FWEA_areasurvey_fk FOREIGN KEY (id)
REFERENCES cityobject (id);
ALTER TABLE FWEA_areasurvey ADD CONSTRAINT FWEA_areasurve_objectcl_fk FOREIGN KEY (objectclass_id)
REFERENCES objectclass (id);
ALTER TABLE FWEA_areasurvey ADD CONSTRAINT FWEA_areasu_fwear_consi_fk FOREIGN KEY (fwearea_consistsoffwesurv_id)
REFERENCES FWEA_fwearea (id)
ON DELETE SET NULL;
-- --------------------------------------------------------------------
-- FWEA_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_energysurvey ADD CONSTRAINT FWEA_energysurvey_fk FOREIGN KEY (id)
REFERENCES FWEA_areasurvey (id);
ALTER TABLE FWEA_energysurvey ADD CONSTRAINT FWEA_energy_areas_energ_fk FOREIGN KEY (areasurvey_energysurvey_id)
REFERENCES FWEA_areasurvey (id);
-- --------------------------------------------------------------------
-- FWEA_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_foodsurvey ADD CONSTRAINT FWEA_foodsurvey_fk FOREIGN KEY (id)
REFERENCES FWEA_areasurvey (id);
ALTER TABLE FWEA_foodsurvey ADD CONSTRAINT FWEA_foodsu_areas_foods_fk FOREIGN KEY (areasurvey_foodsurvey_id)
REFERENCES FWEA_areasurvey (id);
-- --------------------------------------------------------------------
-- FWEA_fwearea
-- --------------------------------------------------------------------
ALTER TABLE FWEA_fwearea ADD CONSTRAINT FWEA_fwearea_fk FOREIGN KEY (id)
REFERENCES cityobject (id);
ALTER TABLE FWEA_fwearea ADD CONSTRAINT FWEA_fwearea_lod0multis_fk FOREIGN KEY (lod0multisurface_id)
REFERENCES surface_geometry (id);
-- --------------------------------------------------------------------
-- FWEA_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_watersurvey ADD CONSTRAINT FWEA_watersurvey_fk FOREIGN KEY (id)
REFERENCES FWEA_areasurvey (id);
ALTER TABLE FWEA_watersurvey ADD CONSTRAINT FWEA_waters_areas_water_fk FOREIGN KEY (areasurvey_watersurvey_id)
REFERENCES FWEA_areasurvey (id);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Indexes *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEA_areasurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEA_areas_fwear_consi_fkx ON FWEA_areasurvey
USING btree
(
fwearea_consistsoffwesurv_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
CREATE INDEX FWEA_areasurv_objectcl_fkx ON FWEA_areasurvey
USING btree
(
objectclass_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- --------------------------------------------------------------------
-- FWEA_energysurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEA_energ_areas_energ_fkx ON FWEA_energysurvey
USING btree
(
areasurvey_energysurvey_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- --------------------------------------------------------------------
-- FWEA_foodsurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEA_foods_areas_foods_fkx ON FWEA_foodsurvey
USING btree
(
areasurvey_foodsurvey_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- --------------------------------------------------------------------
-- FWEA_fwearea
-- --------------------------------------------------------------------
CREATE INDEX FWEA_fwearea_lod0multi_fkx ON FWEA_fwearea
USING btree
(
lod0multisurface_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- --------------------------------------------------------------------
-- FWEA_watersurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEA_water_areas_water_fkx ON FWEA_watersurvey
USING btree
(
areasurvey_watersurvey_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Sequences ***********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:56:23
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop foreign keys **********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEA_areasurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_areasurvey
DROP CONSTRAINT FWEA_areasurvey_fk;
ALTER TABLE FWEA_areasurvey
DROP CONSTRAINT FWEA_areasurve_objectcl_fk;
ALTER TABLE FWEA_areasurvey
DROP CONSTRAINT FWEA_areasu_fwear_consi_fk;
-- --------------------------------------------------------------------
-- FWEA_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_energysurvey
DROP CONSTRAINT FWEA_energysurvey_fk;
ALTER TABLE FWEA_energysurvey
DROP CONSTRAINT FWEA_energy_areas_energ_fk;
-- --------------------------------------------------------------------
-- FWEA_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_foodsurvey
DROP CONSTRAINT FWEA_foodsurvey_fk;
ALTER TABLE FWEA_foodsurvey
DROP CONSTRAINT FWEA_foodsu_areas_foods_fk;
-- --------------------------------------------------------------------
-- FWEA_fwearea
-- --------------------------------------------------------------------
ALTER TABLE FWEA_fwearea
DROP CONSTRAINT FWEA_fwearea_fk;
ALTER TABLE FWEA_fwearea
DROP CONSTRAINT FWEA_fwearea_lod0multis_fk;
-- --------------------------------------------------------------------
-- FWEA_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEA_watersurvey
DROP CONSTRAINT FWEA_watersurvey_fk;
ALTER TABLE FWEA_watersurvey
DROP CONSTRAINT FWEA_waters_areas_water_fk;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop tables ***************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEA_areasurvey
-- --------------------------------------------------------------------
DROP TABLE FWEA_areasurvey;
-- --------------------------------------------------------------------
-- FWEA_energysurvey
-- --------------------------------------------------------------------
DROP TABLE FWEA_energysurvey;
-- --------------------------------------------------------------------
-- FWEA_foodsurvey
-- --------------------------------------------------------------------
DROP TABLE FWEA_foodsurvey;
-- --------------------------------------------------------------------
-- FWEA_fwearea
-- --------------------------------------------------------------------
DROP TABLE FWEA_fwearea;
-- --------------------------------------------------------------------
-- FWEA_watersurvey
-- --------------------------------------------------------------------
DROP TABLE FWEA_watersurvey;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop Sequences *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<schemaMapping xmlns="http://www.3dcitydb.org/database/schema/1.0">
<metadata>
<name>FWEArea</name>
<version>2.1</version>
<description>Area thematic class of FWE ADE</description>
<dbPrefix>FWEA</dbPrefix>
</metadata>
<applicationSchemas>
<schema id="FWEA" isADERoot="true">
<namespace context="citygml-2.0">http://transfer.hft-stuttgart.de/pages/fwe-ade/FWEArea/v2.1/XSD</namespace>
</schema>
</applicationSchemas>
<featureTypes>
<featureType id="FWEA_AreaSurveyType" table="FWEA_areasurvey" objectClassId="30000" path="AreaSurvey" schema="FWEA">
<extension base="AbstractFeatureType">
<join table="cityobject" fromColumn="id" toColumn="id" toRole="parent"/>
</extension>
<attribute column="surveyyear" type="integer" path="surveyYear" schema="FWEA"/>
<attribute column="surveyyearversion" type="double" path="surveyYearVersion" schema="FWEA"/>
<attribute column="surveydescription" type="string" path="surveyDescription" schema="FWEA"/>
<attribute column="population" type="integer" maxOccurs="1" path="population" schema="FWEA"/>
<complexAttribute maxOccurs="1" path="buildingFootrpintArea" schema="FWEA">
<attribute column="buildingfootrpintarea_uom" type="string" path="@uom" schema="gml"/>
<attribute column="buildingfootrpintarea" type="double" path="." schema="FWEA"/>
</complexAttribute>
<complexAttribute maxOccurs="1" path="settlementArea" schema="FWEA">
<attribute column="settlementarea_uom" type="string" path="@uom" schema="gml"/>
<attribute column="settlementarea" type="double" path="." schema="FWEA"/>
</complexAttribute>
<complexAttribute maxOccurs="1" path="openPlotArea" schema="FWEA">
<attribute column="openplotarea_uom" type="string" path="@uom" schema="gml"/>
<attribute column="openplotarea" type="double" path="." schema="FWEA"/>
</complexAttribute>
<complexAttribute maxOccurs="1" path="surfaceArea" schema="FWEA">
<attribute column="surfacearea_uom" type="string" path="@uom" schema="gml"/>
<attribute column="surfacearea" type="double" path="." schema="FWEA"/>
</complexAttribute>
<complexAttribute maxOccurs="1" path="trafficArea" schema="FWEA">
<attribute column="trafficarea_uom" type="string" path="@uom" schema="gml"/>
<attribute column="trafficarea" type="double" path="." schema="FWEA"/>
</complexAttribute>
<complexAttribute maxOccurs="1" path="vegetationArea" schema="FWEA">
<attribute column="vegetationarea_uom" type="string" path="@uom" schema="gml"/>
<attribute column="vegetationarea" type="double" path="." schema="FWEA"/>
</complexAttribute>
<complexAttribute maxOccurs="1" path="waterBodyArea" schema="FWEA">
<attribute column="waterbodyarea_uom" type="string" path="@uom" schema="gml"/>
<attribute column="waterbodyarea" type="double" path="." schema="FWEA"/>
</complexAttribute>
<featureProperty target="FWEA_FoodSurveyType" relationType="composition" path="foodSurvey" schema="FWEA">
<join table="FWEA_foodsurvey" fromColumn="id" toColumn="areasurvey_foodsurvey_id" toRole="child"/>
</featureProperty>
<featureProperty target="FWEA_WaterSurveyType" relationType="composition" path="waterSurvey" schema="FWEA">
<join table="FWEA_watersurvey" fromColumn="id" toColumn="areasurvey_watersurvey_id" toRole="child"/>
</featureProperty>
<featureProperty target="FWEA_EnergySurveyType" relationType="composition" path="energySurvey" schema="FWEA">
<join table="FWEA_energysurvey" fromColumn="id" toColumn="areasurvey_energysurvey_id" toRole="child"/>
</featureProperty>
</featureType>
<featureType id="FWEA_FoodSurveyType" table="FWEA_foodsurvey" objectClassId="30001" path="FoodSurvey" schema="FWEA">
<extension base="FWEA_AreaSurveyType">
<join table="FWEA_areasurvey" fromColumn="id" toColumn="id" toRole="parent"/>
</extension>
<complexAttribute path="foodCategory" schema="FWEA">
<attribute column="foodcategory_codespace" type="string" path="@codespace" schema="gml"/>
<attribute column="foodcategory" type="string" path="." schema="FWEA"/>
</complexAttribute>
<attribute column="fooddemand" type="double" maxOccurs="1" path="foodDemand" schema="FWEA"/>
<attribute column="fooddemandunit" type="string" maxOccurs="1" path="foodDemandUnit" schema="FWEA"/>
<attribute column="foodproduction" type="double" maxOccurs="1" path="foodProduction" schema="FWEA"/>
<attribute column="foodproductionunit" type="string" maxOccurs="1" path="foodProductionUnit" schema="FWEA"/>
<attribute column="foodproductionwaterdemand" type="double" maxOccurs="1" path="foodProductionWaterDemand" schema="FWEA"/>
<attribute column="foodproductionwaterdemanduni" type="string" maxOccurs="1" path="foodProductionWaterDemandUnit" schema="FWEA"/>
<attribute column="foodproductionenergydemand" type="double" maxOccurs="1" path="foodProductionEnergyDemand" schema="FWEA"/>
<attribute column="foodproductionenergydemandun" type="string" maxOccurs="1" path="foodProductionEnergyDemandUnit" schema="FWEA"/>
<attribute column="foodconsumption" type="double" maxOccurs="1" path="foodConsumption" schema="FWEA"/>
<attribute column="foodconsumptionunit" type="string" maxOccurs="1" path="foodConsumptionUnit" schema="FWEA"/>
</featureType>
<featureType id="FWEA_WaterSurveyType" table="FWEA_watersurvey" objectClassId="30002" path="WaterSurvey" schema="FWEA">
<extension base="FWEA_AreaSurveyType">
<join table="FWEA_areasurvey" fromColumn="id" toColumn="id" toRole="parent"/>
</extension>
<attribute column="domesticwaterdemand" type="double" maxOccurs="1" path="domesticWaterDemand" schema="FWEA"/>
<attribute column="domesticwaterdemandunit" type="string" maxOccurs="1" path="domesticWaterDemandUnit" schema="FWEA"/>
<attribute column="domestichotwaterdemand" type="double" maxOccurs="1" path="domesticHotWaterDemand" schema="FWEA"/>
<attribute column="domestichotwaterdemandunit" type="string" maxOccurs="1" path="domesticHotWaterDemandUnit" schema="FWEA"/>
<attribute column="domesticwaterwaste" type="double" maxOccurs="1" path="domesticWaterWaste" schema="FWEA"/>
<attribute column="domesticwaterwasteunit" type="string" maxOccurs="1" path="domesticWaterWasteUnit" schema="FWEA"/>
<attribute column="domesticsolidwaste" type="double" maxOccurs="1" path="domesticSolidWaste" schema="FWEA"/>
<attribute column="domesticsolidwasteunit" type="string" maxOccurs="1" path="domesticSolidWasteUnit" schema="FWEA"/>
<attribute column="totaldomesticwaste" type="double" maxOccurs="1" path="totalDomesticWaste" schema="FWEA"/>
<attribute column="totaldomesticwasteunit" type="string" maxOccurs="1" path="totalDomesticWasteUnit" schema="FWEA"/>
<attribute column="totaldomesticwasteenergypote" type="double" maxOccurs="1" path="totalDomesticWasteEnergyPotential" schema="FWEA"/>
<attribute column="totaldomesticwasteenergypo_1" type="string" maxOccurs="1" path="totalDomesticWasteEnergyPotentialUnit" schema="FWEA"/>
</featureType>
<featureType id="FWEA_EnergySurveyType" table="FWEA_energysurvey" objectClassId="30003" path="EnergySurvey" schema="FWEA">
<extension base="FWEA_AreaSurveyType">
<join table="FWEA_areasurvey" fromColumn="id" toColumn="id" toRole="parent"/>
</extension>
<attribute column="spaceheatingdemand" type="double" maxOccurs="1" path="spaceHeatingDemand" schema="FWEA"/>
<attribute column="spaceheatingdemandunit" type="string" maxOccurs="1" path="spaceHeatingDemandUnit" schema="FWEA"/>
<attribute column="spacecoolingdemand" type="double" maxOccurs="1" path="spaceCoolingDemand" schema="FWEA"/>
<attribute column="spacecoolingdemandunit" type="string" maxOccurs="1" path="spaceCoolingDemandUnit" schema="FWEA"/>
<attribute column="residentialelectricitydemand" type="double" maxOccurs="1" path="residentialElectricityDemand" schema="FWEA"/>
<attribute column="residentialelectricitydema_1" type="string" maxOccurs="1" path="residentialElectricityDemandUnit" schema="FWEA"/>
<attribute column="electricitypotentialfrompvbu" type="double" maxOccurs="1" path="electricityPotentialFromPVBuildings" schema="FWEA"/>
<attribute column="electricitypotentialfrompv_1" type="string" maxOccurs="1" path="electricityPotentialFromPVBuildingsUnit" schema="FWEA"/>
<attribute column="biomassprimaryenergypotentia" type="double" maxOccurs="1" path="biomassPrimaryEnergyPotential" schema="FWEA"/>
<attribute column="biomassprimaryenergypotent_1" type="string" maxOccurs="1" path="biomassPrimaryEnergyPotentialUnit" schema="FWEA"/>
<attribute column="biomasselectricitypotential" type="double" maxOccurs="1" path="biomassElectricityPotential" schema="FWEA"/>
<attribute column="biomasselectricitypotentialu" type="string" maxOccurs="1" path="biomassElectricityPotentialUnit" schema="FWEA"/>
<attribute column="biomassthermalpotential" type="double" maxOccurs="1" path="biomassThermalPotential" schema="FWEA"/>
<attribute column="biomassthermalpotentialunit" type="string" maxOccurs="1" path="biomassThermalPotentialUnit" schema="FWEA"/>
</featureType>
<featureType id="FWEA_FWEAreaType" table="FWEA_fwearea" objectClassId="30004" topLevel="true" path="FWEArea" schema="FWEA">
<extension base="AbstractCityObjectType">
<join table="cityobject" fromColumn="id" toColumn="id" toRole="parent"/>
</extension>
<attribute column="fweareaname" type="string" maxOccurs="1" path="fweAreaName" schema="FWEA"/>
<attribute column="fwesystemname" type="string" maxOccurs="1" path="fweSystemName" schema="FWEA"/>
<geometryProperty lod="0" refColumn="lod0multisurface_id" type="MultiSurface" maxOccurs="1" path="lod0MultiSurface" schema="FWEA"/>
<featureProperty target="FWEA_AreaSurveyType" path="consistsOfFWEsurvey" schema="FWEA">
<join table="FWEA_areasurvey" fromColumn="id" toColumn="fwearea_consistsoffwesurv_id" toRole="child">
<condition column="objectclass_id" value="${target.objectclass_id}" type="integer"/>
</join>
</featureProperty>
</featureType>
</featureTypes>
</schemaMapping>
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:53:44
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create tables **************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEB_building
-- --------------------------------------------------------------------
CREATE TABLE FWEB_building
(
id INTEGER NOT NULL,
fweareaname VARCHAR2(1000),
fwesystemname VARCHAR2(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEB_buildingsurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEB_buildingsurvey
(
id INTEGER NOT NULL,
building_consistsoffwesur_id INTEGER,
buildingfootprintarea NUMBER,
buildingfootprintarea_uom VARCHAR2(1000),
objectclass_id INTEGER,
occupants INTEGER,
surveydescription VARCHAR2(1000),
surveyyear INTEGER,
surveyyearversion NUMBER,
totalfloorarea NUMBER,
totalfloorarea_uom VARCHAR2(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEB_energysurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEB_energysurvey
(
id INTEGER NOT NULL,
buildingsurv_energysurvey_id INTEGER,
electricitypotentialfrompv NUMBER,
electricitypotentialfrompvun VARCHAR2(1000),
residentialelectricitydema_1 VARCHAR2(1000),
residentialelectricitydemand NUMBER,
spacecoolingdemand NUMBER,
spacecoolingdemandunit VARCHAR2(1000),
spaceheatingdemand NUMBER,
spaceheatingdemandunit VARCHAR2(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEB_foodsurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEB_foodsurvey
(
id INTEGER NOT NULL,
buildingsurvey_foodsurvey_id INTEGER,
foodcategory VARCHAR2(1000),
foodcategory_codespace VARCHAR2(1000),
foodconsumption NUMBER,
foodconsumptionunit VARCHAR2(1000),
fooddemand NUMBER,
fooddemandunit VARCHAR2(1000),
foodproduction NUMBER,
foodproductionenergydemand NUMBER,
foodproductionenergydemandun VARCHAR2(1000),
foodproductionunit VARCHAR2(1000),
foodproductionwaterdemand NUMBER,
foodproductionwaterdemanduni VARCHAR2(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEB_watersurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEB_watersurvey
(
id INTEGER NOT NULL,
buildingsurve_watersurvey_id INTEGER,
domestichotwaterdemand NUMBER,
domestichotwaterdemandunit VARCHAR2(1000),
domestichotwaterenergydema_1 VARCHAR2(1000),
domestichotwaterenergydemand NUMBER,
domesticsolidwaste NUMBER,
domesticsolidwasteunit VARCHAR2(1000),
domesticwaterdemand NUMBER,
domesticwaterdemandunit VARCHAR2(1000),
domesticwaterwaste NUMBER,
domesticwaterwasteunit VARCHAR2(1000),
totaldomesticwaste NUMBER,
totaldomesticwasteunit VARCHAR2(1000),
PRIMARY KEY (id)
);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create foreign keys ********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEB_building
-- --------------------------------------------------------------------
ALTER TABLE FWEB_building ADD CONSTRAINT FWEB_building_fk FOREIGN KEY (id)
REFERENCES building (id);
-- --------------------------------------------------------------------
-- FWEB_buildingsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_buildingsurvey ADD CONSTRAINT FWEB_buildingsurvey_fk FOREIGN KEY (id)
REFERENCES cityobject (id);
ALTER TABLE FWEB_buildingsurvey ADD CONSTRAINT FWEB_buildings_objectcl_fk FOREIGN KEY (objectclass_id)
REFERENCES objectclass (id);
ALTER TABLE FWEB_buildingsurvey ADD CONSTRAINT FWEB_buildi_build_consi_fk FOREIGN KEY (building_consistsoffwesur_id)
REFERENCES FWEB_building (id);
-- --------------------------------------------------------------------
-- FWEB_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_energysurvey ADD CONSTRAINT FWEB_energysurvey_fk FOREIGN KEY (id)
REFERENCES FWEB_buildingsurvey (id);
ALTER TABLE FWEB_energysurvey ADD CONSTRAINT FWEB_energy_build_energ_fk FOREIGN KEY (buildingsurv_energysurvey_id)
REFERENCES FWEB_buildingsurvey (id);
-- --------------------------------------------------------------------
-- FWEB_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_foodsurvey ADD CONSTRAINT FWEB_foodsurvey_fk FOREIGN KEY (id)
REFERENCES FWEB_buildingsurvey (id);
ALTER TABLE FWEB_foodsurvey ADD CONSTRAINT FWEB_foodsu_build_foods_fk FOREIGN KEY (buildingsurvey_foodsurvey_id)
REFERENCES FWEB_buildingsurvey (id);
-- --------------------------------------------------------------------
-- FWEB_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_watersurvey ADD CONSTRAINT FWEB_watersurvey_fk FOREIGN KEY (id)
REFERENCES FWEB_buildingsurvey (id);
ALTER TABLE FWEB_watersurvey ADD CONSTRAINT FWEB_waters_build_water_fk FOREIGN KEY (buildingsurve_watersurvey_id)
REFERENCES FWEB_buildingsurvey (id);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Indexes *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEB_buildingsurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEB_build_build_consi_fkx ON FWEB_buildingsurvey (building_consistsoffwesur_id);
CREATE INDEX FWEB_building_objectcl_fkx ON FWEB_buildingsurvey (objectclass_id);
-- --------------------------------------------------------------------
-- FWEB_energysurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEB_energ_build_energ_fkx ON FWEB_energysurvey (buildingsurv_energysurvey_id);
-- --------------------------------------------------------------------
-- FWEB_foodsurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEB_foods_build_foods_fkx ON FWEB_foodsurvey (buildingsurvey_foodsurvey_id);
-- --------------------------------------------------------------------
-- FWEB_watersurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEB_water_build_water_fkx ON FWEB_watersurvey (buildingsurve_watersurvey_id);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Sequences ***********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:53:44
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Disable Versioning *********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exec DBMS_WM.DisableVersioning('FWEB_building,FWEB_buildingsurvey,FWEB_energysurvey,FWEB_foodsurvey,FWEB_watersurvey,',true, true);
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:53:44
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop foreign keys **********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEB_building
-- --------------------------------------------------------------------
ALTER TABLE FWEB_building
DROP CONSTRAINT FWEB_building_fk;
-- --------------------------------------------------------------------
-- FWEB_buildingsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_buildingsurvey
DROP CONSTRAINT FWEB_buildingsurvey_fk;
ALTER TABLE FWEB_buildingsurvey
DROP CONSTRAINT FWEB_buildings_objectcl_fk;
ALTER TABLE FWEB_buildingsurvey
DROP CONSTRAINT FWEB_buildi_build_consi_fk;
-- --------------------------------------------------------------------
-- FWEB_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_energysurvey
DROP CONSTRAINT FWEB_energysurvey_fk;
ALTER TABLE FWEB_energysurvey
DROP CONSTRAINT FWEB_energy_build_energ_fk;
-- --------------------------------------------------------------------
-- FWEB_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_foodsurvey
DROP CONSTRAINT FWEB_foodsurvey_fk;
ALTER TABLE FWEB_foodsurvey
DROP CONSTRAINT FWEB_foodsu_build_foods_fk;
-- --------------------------------------------------------------------
-- FWEB_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_watersurvey
DROP CONSTRAINT FWEB_watersurvey_fk;
ALTER TABLE FWEB_watersurvey
DROP CONSTRAINT FWEB_waters_build_water_fk;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop tables ***************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEB_building
-- --------------------------------------------------------------------
DROP TABLE FWEB_building;
-- --------------------------------------------------------------------
-- FWEB_buildingsurvey
-- --------------------------------------------------------------------
DROP TABLE FWEB_buildingsurvey;
-- --------------------------------------------------------------------
-- FWEB_energysurvey
-- --------------------------------------------------------------------
DROP TABLE FWEB_energysurvey;
-- --------------------------------------------------------------------
-- FWEB_foodsurvey
-- --------------------------------------------------------------------
DROP TABLE FWEB_foodsurvey;
-- --------------------------------------------------------------------
-- FWEB_watersurvey
-- --------------------------------------------------------------------
DROP TABLE FWEB_watersurvey;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop Sequences *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PURGE RECYCLEBIN;
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:53:44
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Enable Versioning **********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exec DBMS_WM.EnableVersioning('FWEB_building,FWEB_buildingsurvey,FWEB_energysurvey,FWEB_foodsurvey,FWEB_watersurvey,','VIEW_WO_OVERWRITE');
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:53:44
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create tables **************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEB_building
-- --------------------------------------------------------------------
CREATE TABLE FWEB_building
(
id INTEGER NOT NULL,
fweareaname VARCHAR(1000),
fwesystemname VARCHAR(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEB_buildingsurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEB_buildingsurvey
(
id INTEGER NOT NULL,
building_consistsoffwesur_id INTEGER,
buildingfootprintarea NUMERIC,
buildingfootprintarea_uom VARCHAR(1000),
objectclass_id INTEGER,
occupants INTEGER,
surveydescription VARCHAR(1000),
surveyyear INTEGER,
surveyyearversion NUMERIC,
totalfloorarea NUMERIC,
totalfloorarea_uom VARCHAR(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEB_energysurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEB_energysurvey
(
id INTEGER NOT NULL,
buildingsurv_energysurvey_id INTEGER,
electricitypotentialfrompv NUMERIC,
electricitypotentialfrompvun VARCHAR(1000),
residentialelectricitydema_1 VARCHAR(1000),
residentialelectricitydemand NUMERIC,
spacecoolingdemand NUMERIC,
spacecoolingdemandunit VARCHAR(1000),
spaceheatingdemand NUMERIC,
spaceheatingdemandunit VARCHAR(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEB_foodsurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEB_foodsurvey
(
id INTEGER NOT NULL,
buildingsurvey_foodsurvey_id INTEGER,
foodcategory VARCHAR(1000),
foodcategory_codespace VARCHAR(1000),
foodconsumption NUMERIC,
foodconsumptionunit VARCHAR(1000),
fooddemand NUMERIC,
fooddemandunit VARCHAR(1000),
foodproduction NUMERIC,
foodproductionenergydemand NUMERIC,
foodproductionenergydemandun VARCHAR(1000),
foodproductionunit VARCHAR(1000),
foodproductionwaterdemand NUMERIC,
foodproductionwaterdemanduni VARCHAR(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEB_watersurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEB_watersurvey
(
id INTEGER NOT NULL,
buildingsurve_watersurvey_id INTEGER,
domestichotwaterdemand NUMERIC,
domestichotwaterdemandunit VARCHAR(1000),
domestichotwaterenergydema_1 VARCHAR(1000),
domestichotwaterenergydemand NUMERIC,
domesticsolidwaste NUMERIC,
domesticsolidwasteunit VARCHAR(1000),
domesticwaterdemand NUMERIC,
domesticwaterdemandunit VARCHAR(1000),
domesticwaterwaste NUMERIC,
domesticwaterwasteunit VARCHAR(1000),
totaldomesticwaste NUMERIC,
totaldomesticwasteunit VARCHAR(1000),
PRIMARY KEY (id)
);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create foreign keys ********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEB_building
-- --------------------------------------------------------------------
ALTER TABLE FWEB_building ADD CONSTRAINT FWEB_building_fk FOREIGN KEY (id)
REFERENCES building (id);
-- --------------------------------------------------------------------
-- FWEB_buildingsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_buildingsurvey ADD CONSTRAINT FWEB_buildingsurvey_fk FOREIGN KEY (id)
REFERENCES cityobject (id);
ALTER TABLE FWEB_buildingsurvey ADD CONSTRAINT FWEB_buildings_objectcl_fk FOREIGN KEY (objectclass_id)
REFERENCES objectclass (id);
ALTER TABLE FWEB_buildingsurvey ADD CONSTRAINT FWEB_buildi_build_consi_fk FOREIGN KEY (building_consistsoffwesur_id)
REFERENCES FWEB_building (id);
-- --------------------------------------------------------------------
-- FWEB_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_energysurvey ADD CONSTRAINT FWEB_energysurvey_fk FOREIGN KEY (id)
REFERENCES FWEB_buildingsurvey (id);
ALTER TABLE FWEB_energysurvey ADD CONSTRAINT FWEB_energy_build_energ_fk FOREIGN KEY (buildingsurv_energysurvey_id)
REFERENCES FWEB_buildingsurvey (id);
-- --------------------------------------------------------------------
-- FWEB_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_foodsurvey ADD CONSTRAINT FWEB_foodsurvey_fk FOREIGN KEY (id)
REFERENCES FWEB_buildingsurvey (id);
ALTER TABLE FWEB_foodsurvey ADD CONSTRAINT FWEB_foodsu_build_foods_fk FOREIGN KEY (buildingsurvey_foodsurvey_id)
REFERENCES FWEB_buildingsurvey (id);
-- --------------------------------------------------------------------
-- FWEB_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_watersurvey ADD CONSTRAINT FWEB_watersurvey_fk FOREIGN KEY (id)
REFERENCES FWEB_buildingsurvey (id);
ALTER TABLE FWEB_watersurvey ADD CONSTRAINT FWEB_waters_build_water_fk FOREIGN KEY (buildingsurve_watersurvey_id)
REFERENCES FWEB_buildingsurvey (id);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Indexes *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEB_buildingsurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEB_build_build_consi_fkx ON FWEB_buildingsurvey
USING btree
(
building_consistsoffwesur_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
CREATE INDEX FWEB_building_objectcl_fkx ON FWEB_buildingsurvey
USING btree
(
objectclass_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- --------------------------------------------------------------------
-- FWEB_energysurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEB_energ_build_energ_fkx ON FWEB_energysurvey
USING btree
(
buildingsurv_energysurvey_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- --------------------------------------------------------------------
-- FWEB_foodsurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEB_foods_build_foods_fkx ON FWEB_foodsurvey
USING btree
(
buildingsurvey_foodsurvey_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- --------------------------------------------------------------------
-- FWEB_watersurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEB_water_build_water_fkx ON FWEB_watersurvey
USING btree
(
buildingsurve_watersurvey_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Sequences ***********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:53:44
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop foreign keys **********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEB_building
-- --------------------------------------------------------------------
ALTER TABLE FWEB_building
DROP CONSTRAINT FWEB_building_fk;
-- --------------------------------------------------------------------
-- FWEB_buildingsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_buildingsurvey
DROP CONSTRAINT FWEB_buildingsurvey_fk;
ALTER TABLE FWEB_buildingsurvey
DROP CONSTRAINT FWEB_buildings_objectcl_fk;
ALTER TABLE FWEB_buildingsurvey
DROP CONSTRAINT FWEB_buildi_build_consi_fk;
-- --------------------------------------------------------------------
-- FWEB_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_energysurvey
DROP CONSTRAINT FWEB_energysurvey_fk;
ALTER TABLE FWEB_energysurvey
DROP CONSTRAINT FWEB_energy_build_energ_fk;
-- --------------------------------------------------------------------
-- FWEB_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_foodsurvey
DROP CONSTRAINT FWEB_foodsurvey_fk;
ALTER TABLE FWEB_foodsurvey
DROP CONSTRAINT FWEB_foodsu_build_foods_fk;
-- --------------------------------------------------------------------
-- FWEB_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEB_watersurvey
DROP CONSTRAINT FWEB_watersurvey_fk;
ALTER TABLE FWEB_watersurvey
DROP CONSTRAINT FWEB_waters_build_water_fk;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop tables ***************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEB_building
-- --------------------------------------------------------------------
DROP TABLE FWEB_building;
-- --------------------------------------------------------------------
-- FWEB_buildingsurvey
-- --------------------------------------------------------------------
DROP TABLE FWEB_buildingsurvey;
-- --------------------------------------------------------------------
-- FWEB_energysurvey
-- --------------------------------------------------------------------
DROP TABLE FWEB_energysurvey;
-- --------------------------------------------------------------------
-- FWEB_foodsurvey
-- --------------------------------------------------------------------
DROP TABLE FWEB_foodsurvey;
-- --------------------------------------------------------------------
-- FWEB_watersurvey
-- --------------------------------------------------------------------
DROP TABLE FWEB_watersurvey;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop Sequences *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<schemaMapping xmlns="http://www.3dcitydb.org/database/schema/1.0">
<metadata>
<name>FWEBuilding</name>
<version>2.1</version>
<description>Building thematic class of FWE ADE</description>
<dbPrefix>FWEB</dbPrefix>
</metadata>
<applicationSchemas>
<schema id="FWEB" isADERoot="true">
<namespace context="citygml-2.0">http://transfer.hft-stuttgart.de/pages/fwe-ade/FWEBuilding/v2.1/XSD</namespace>
</schema>
</applicationSchemas>
<featureTypes>
<featureType id="FWEB_BuildingSurveyType" table="FWEB_buildingsurvey" objectClassId="10000" path="BuildingSurvey" schema="FWEB">
<extension base="AbstractFeatureType">
<join table="cityobject" fromColumn="id" toColumn="id" toRole="parent"/>
</extension>
<attribute column="surveyyear" type="integer" path="surveyYear" schema="FWEB"/>
<attribute column="surveyyearversion" type="double" path="surveyYearVersion" schema="FWEB"/>
<attribute column="surveydescription" type="string" path="surveyDescription" schema="FWEB"/>
<attribute column="occupants" type="integer" maxOccurs="1" path="occupants" schema="FWEB"/>
<complexAttribute maxOccurs="1" path="buildingFootprintArea" schema="FWEB">
<attribute column="buildingfootprintarea_uom" type="string" path="@uom" schema="gml"/>
<attribute column="buildingfootprintarea" type="double" path="." schema="FWEB"/>
</complexAttribute>
<complexAttribute maxOccurs="1" path="totalFloorArea" schema="FWEB">
<attribute column="totalfloorarea_uom" type="string" path="@uom" schema="gml"/>
<attribute column="totalfloorarea" type="double" path="." schema="FWEB"/>
</complexAttribute>
<featureProperty target="FWEB_FoodSurveyType" relationType="composition" path="foodSurvey" schema="FWEB">
<join table="FWEB_foodsurvey" fromColumn="id" toColumn="buildingsurvey_foodsurvey_id" toRole="child"/>
</featureProperty>
<featureProperty target="FWEB_WaterSurveyType" relationType="composition" path="waterSurvey" schema="FWEB">
<join table="FWEB_watersurvey" fromColumn="id" toColumn="buildingsurve_watersurvey_id" toRole="child"/>
</featureProperty>
<featureProperty target="FWEB_EnergySurveyType" relationType="composition" path="energySurvey" schema="FWEB">
<join table="FWEB_energysurvey" fromColumn="id" toColumn="buildingsurv_energysurvey_id" toRole="child"/>
</featureProperty>
</featureType>
<featureType id="FWEB_FoodSurveyType" table="FWEB_foodsurvey" objectClassId="10001" path="FoodSurvey" schema="FWEB">
<extension base="FWEB_BuildingSurveyType">
<join table="FWEB_buildingsurvey" fromColumn="id" toColumn="id" toRole="parent"/>
</extension>
<complexAttribute path="foodCategory" schema="FWEB">
<attribute column="foodcategory_codespace" type="string" path="@codespace" schema="gml"/>
<attribute column="foodcategory" type="string" path="." schema="FWEB"/>
</complexAttribute>
<attribute column="fooddemand" type="double" maxOccurs="1" path="foodDemand" schema="FWEB"/>
<attribute column="fooddemandunit" type="string" maxOccurs="1" path="foodDemandUnit" schema="FWEB"/>
<attribute column="foodproduction" type="double" maxOccurs="1" path="foodProduction" schema="FWEB"/>
<attribute column="foodproductionunit" type="string" maxOccurs="1" path="foodProductionUnit" schema="FWEB"/>
<attribute column="foodproductionwaterdemand" type="double" maxOccurs="1" path="foodProductionWaterDemand" schema="FWEB"/>
<attribute column="foodproductionwaterdemanduni" type="string" maxOccurs="1" path="foodProductionWaterDemandUnit" schema="FWEB"/>
<attribute column="foodproductionenergydemand" type="double" maxOccurs="1" path="foodProductionEnergyDemand" schema="FWEB"/>
<attribute column="foodproductionenergydemandun" type="string" maxOccurs="1" path="foodProductionEnergyDemandUnit" schema="FWEB"/>
<attribute column="foodconsumption" type="double" maxOccurs="1" path="foodConsumption" schema="FWEB"/>
<attribute column="foodconsumptionunit" type="string" maxOccurs="1" path="foodConsumptionUnit" schema="FWEB"/>
</featureType>
<featureType id="FWEB_WaterSurveyType" table="FWEB_watersurvey" objectClassId="10002" path="WaterSurvey" schema="FWEB">
<extension base="FWEB_BuildingSurveyType">
<join table="FWEB_buildingsurvey" fromColumn="id" toColumn="id" toRole="parent"/>
</extension>
<attribute column="domesticwaterdemand" type="double" maxOccurs="1" path="domesticWaterDemand" schema="FWEB"/>
<attribute column="domesticwaterdemandunit" type="string" maxOccurs="1" path="domesticWaterDemandUnit" schema="FWEB"/>
<attribute column="domestichotwaterdemand" type="double" maxOccurs="1" path="domesticHotWaterDemand" schema="FWEB"/>
<attribute column="domestichotwaterdemandunit" type="string" maxOccurs="1" path="domesticHotWaterDemandUnit" schema="FWEB"/>
<attribute column="domestichotwaterenergydemand" type="double" maxOccurs="1" path="domesticHotWaterEnergyDemand" schema="FWEB"/>
<attribute column="domestichotwaterenergydema_1" type="string" maxOccurs="1" path="domesticHotWaterEnergyDemandUnit" schema="FWEB"/>
<attribute column="domesticwaterwaste" type="double" maxOccurs="1" path="domesticWaterWaste" schema="FWEB"/>
<attribute column="domesticwaterwasteunit" type="string" maxOccurs="1" path="domesticWaterWasteUnit" schema="FWEB"/>
<attribute column="domesticsolidwaste" type="double" maxOccurs="1" path="domesticSolidWaste" schema="FWEB"/>
<attribute column="domesticsolidwasteunit" type="string" maxOccurs="1" path="domesticSolidWasteUnit" schema="FWEB"/>
<attribute column="totaldomesticwaste" type="double" maxOccurs="1" path="totalDomesticWaste" schema="FWEB"/>
<attribute column="totaldomesticwasteunit" type="string" maxOccurs="1" path="totalDomesticWasteUnit" schema="FWEB"/>
</featureType>
<featureType id="FWEB_EnergySurveyType" table="FWEB_energysurvey" objectClassId="10003" path="EnergySurvey" schema="FWEB">
<extension base="FWEB_BuildingSurveyType">
<join table="FWEB_buildingsurvey" fromColumn="id" toColumn="id" toRole="parent"/>
</extension>
<attribute column="spaceheatingdemand" type="double" maxOccurs="1" path="spaceHeatingDemand" schema="FWEB"/>
<attribute column="spaceheatingdemandunit" type="string" maxOccurs="1" path="spaceHeatingDemandUnit" schema="FWEB"/>
<attribute column="spacecoolingdemand" type="double" maxOccurs="1" path="spaceCoolingDemand" schema="FWEB"/>
<attribute column="spacecoolingdemandunit" type="string" maxOccurs="1" path="spaceCoolingDemandUnit" schema="FWEB"/>
<attribute column="residentialelectricitydemand" type="double" maxOccurs="1" path="residentialElectricityDemand" schema="FWEB"/>
<attribute column="residentialelectricitydema_1" type="string" maxOccurs="1" path="residentialElectricityDemandUnit" schema="FWEB"/>
<attribute column="electricitypotentialfrompv" type="double" maxOccurs="1" path="electricityPotentialFromPV" schema="FWEB"/>
<attribute column="electricitypotentialfrompvun" type="string" maxOccurs="1" path="electricityPotentialfromPVUnit" schema="FWEB"/>
</featureType>
</featureTypes>
<propertyInjections>
<propertyInjection table="FWEB_building" defaultBase="AbstractBuildingType">
<join table="FWEB_building" fromColumn="ID" toColumn="ID" toRole="child"/>
<attribute column="fweareaname" type="string" maxOccurs="1" path="fweAreaName" schema="FWEB"/>
<attribute column="fwesystemname" type="string" maxOccurs="1" path="fweSystemName" schema="FWEB"/>
<featureProperty target="FWEB_BuildingSurveyType" relationType="composition" path="consistsOfFWEsurvey" schema="FWEB">
<join table="FWEB_buildingsurvey" fromColumn="id" toColumn="building_consistsoffwesur_id" toRole="child">
<condition column="objectclass_id" value="${target.objectclass_id}" type="integer"/>
</join>
</featureProperty>
</propertyInjection>
</propertyInjections>
</schemaMapping>
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:54:48
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create tables **************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEL_energysurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEL_energysurvey
(
id INTEGER NOT NULL,
biomassprimaryenergypotent_1 VARCHAR2(1000),
biomassprimaryenergypotentia NUMBER,
biomasstobioethanol NUMBER,
biomasstobioethanolunit VARCHAR2(1000),
biomasstobiogas NUMBER,
biomasstobiogasunit VARCHAR2(1000),
biomasstoelectricitypotent_1 VARCHAR2(1000),
biomasstoelectricitypotentia NUMBER,
biomasstoenergywoods NUMBER,
biomasstoenergywoodsunit VARCHAR2(1000),
biomasstoplantoil NUMBER,
biomasstoplantoilunit VARCHAR2(1000),
biomasstoresidualsolidfuel NUMBER,
biomasstoresidualsolidfuelun VARCHAR2(1000),
biomasstosolidfuel NUMBER,
biomasstosolidfuelunit VARCHAR2(1000),
biomasstothermalpotential NUMBER,
biomasstothermalpotentialuni VARCHAR2(1000),
electricitypotentialfrompv_1 VARCHAR2(1000),
electricitypotentialfrompvbu NUMBER,
landusesurve_energysurvey_id INTEGER,
residentialelectricitydema_1 VARCHAR2(1000),
residentialelectricitydemand NUMBER,
spacecoolingdemand NUMBER,
spacecoolingdemandunit VARCHAR2(1000),
spaceheatingdemand NUMBER,
spaceheatingdemandunit VARCHAR2(1000),
vegetationcovercat_codespace VARCHAR2(1000),
vegetationcovercategory VARCHAR2(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEL_foodsurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEL_foodsurvey
(
id INTEGER NOT NULL,
foodcategory VARCHAR2(1000),
foodcategory_codespace VARCHAR2(1000),
foodconsumption NUMBER,
foodconsumptionunit VARCHAR2(1000),
fooddemand NUMBER,
fooddemandunit VARCHAR2(1000),
foodproduction NUMBER,
foodproductionenergydemand NUMBER,
foodproductionengerydemandun VARCHAR2(1000),
foodproductionunit VARCHAR2(1000),
foodproductionwaterdemand NUMBER,
foodproductionwaterdemanduni VARCHAR2(1000),
landusesurvey_foodsurvey_id INTEGER,
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEL_land_use
-- --------------------------------------------------------------------
CREATE TABLE FWEL_land_use
(
id INTEGER NOT NULL,
fweareaname VARCHAR2(1000),
fwesystemname VARCHAR2(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEL_landusesurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEL_landusesurvey
(
id INTEGER NOT NULL,
buildingfootprintarea NUMBER,
buildingfootprintarea_uom VARCHAR2(1000),
land_use_consistsoffwesur_id INTEGER,
objectclass_id INTEGER,
population INTEGER,
surfacearea NUMBER,
surfacearea_uom VARCHAR2(1000),
surveydescription VARCHAR2(1000),
surveyyear INTEGER,
surveyyearversion NUMBER,
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEL_watersurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEL_watersurvey
(
id INTEGER NOT NULL,
domestichotwaterdemand NUMBER,
domestichotwaterdemandunit VARCHAR2(1000),
domestichotwaterenergydema_1 VARCHAR2(1000),
domestichotwaterenergydemand NUMBER,
domesticsolidwaste NUMBER,
domesticsolidwasteunit VARCHAR2(1000),
domesticwaterdemand NUMBER,
domesticwaterdemandunit VARCHAR2(1000),
domesticwaterwaste NUMBER,
domesticwaterwasteunit VARCHAR2(1000),
landusesurvey_watersurvey_id INTEGER,
totaldomesticwaste NUMBER,
totaldomesticwasteunit VARCHAR2(1000),
PRIMARY KEY (id)
);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create foreign keys ********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEL_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_energysurvey ADD CONSTRAINT FWEL_energysurvey_fk FOREIGN KEY (id)
REFERENCES FWEL_landusesurvey (id);
ALTER TABLE FWEL_energysurvey ADD CONSTRAINT FWEL_energy_landu_energ_fk FOREIGN KEY (landusesurve_energysurvey_id)
REFERENCES FWEL_landusesurvey (id);
-- --------------------------------------------------------------------
-- FWEL_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_foodsurvey ADD CONSTRAINT FWEL_foodsurvey_fk FOREIGN KEY (id)
REFERENCES FWEL_landusesurvey (id);
ALTER TABLE FWEL_foodsurvey ADD CONSTRAINT FWEL_foodsu_landu_foods_fk FOREIGN KEY (landusesurvey_foodsurvey_id)
REFERENCES FWEL_landusesurvey (id);
-- --------------------------------------------------------------------
-- FWEL_land_use
-- --------------------------------------------------------------------
ALTER TABLE FWEL_land_use ADD CONSTRAINT FWEL_land_use_fk FOREIGN KEY (id)
REFERENCES land_use (id);
-- --------------------------------------------------------------------
-- FWEL_landusesurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_landusesurvey ADD CONSTRAINT FWEL_landusesurvey_fk FOREIGN KEY (id)
REFERENCES cityobject (id);
ALTER TABLE FWEL_landusesurvey ADD CONSTRAINT FWEL_landusesu_objectcl_fk FOREIGN KEY (objectclass_id)
REFERENCES objectclass (id);
ALTER TABLE FWEL_landusesurvey ADD CONSTRAINT FWEL_land_land_use_cons_fk FOREIGN KEY (land_use_consistsoffwesur_id)
REFERENCES FWEL_land_use (id);
-- --------------------------------------------------------------------
-- FWEL_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_watersurvey ADD CONSTRAINT FWEL_watersurvey_fk FOREIGN KEY (id)
REFERENCES FWEL_landusesurvey (id);
ALTER TABLE FWEL_watersurvey ADD CONSTRAINT FWEL_waters_landu_water_fk FOREIGN KEY (landusesurvey_watersurvey_id)
REFERENCES FWEL_landusesurvey (id);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Indexes *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEL_energysurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEL_energ_landu_energ_fkx ON FWEL_energysurvey (landusesurve_energysurvey_id);
-- --------------------------------------------------------------------
-- FWEL_foodsurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEL_foods_landu_foods_fkx ON FWEL_foodsurvey (landusesurvey_foodsurvey_id);
-- --------------------------------------------------------------------
-- FWEL_landusesurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEL_land_land_use_con_fkx ON FWEL_landusesurvey (land_use_consistsoffwesur_id);
CREATE INDEX FWEL_landuses_objectcl_fkx ON FWEL_landusesurvey (objectclass_id);
-- --------------------------------------------------------------------
-- FWEL_watersurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEL_water_landu_water_fkx ON FWEL_watersurvey (landusesurvey_watersurvey_id);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Sequences ***********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:54:48
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Disable Versioning *********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exec DBMS_WM.DisableVersioning('FWEL_energysurvey,FWEL_foodsurvey,FWEL_land_use,FWEL_landusesurvey,FWEL_watersurvey,',true, true);
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:54:48
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop foreign keys **********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEL_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_energysurvey
DROP CONSTRAINT FWEL_energysurvey_fk;
ALTER TABLE FWEL_energysurvey
DROP CONSTRAINT FWEL_energy_landu_energ_fk;
-- --------------------------------------------------------------------
-- FWEL_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_foodsurvey
DROP CONSTRAINT FWEL_foodsurvey_fk;
ALTER TABLE FWEL_foodsurvey
DROP CONSTRAINT FWEL_foodsu_landu_foods_fk;
-- --------------------------------------------------------------------
-- FWEL_land_use
-- --------------------------------------------------------------------
ALTER TABLE FWEL_land_use
DROP CONSTRAINT FWEL_land_use_fk;
-- --------------------------------------------------------------------
-- FWEL_landusesurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_landusesurvey
DROP CONSTRAINT FWEL_landusesurvey_fk;
ALTER TABLE FWEL_landusesurvey
DROP CONSTRAINT FWEL_landusesu_objectcl_fk;
ALTER TABLE FWEL_landusesurvey
DROP CONSTRAINT FWEL_land_land_use_cons_fk;
-- --------------------------------------------------------------------
-- FWEL_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_watersurvey
DROP CONSTRAINT FWEL_watersurvey_fk;
ALTER TABLE FWEL_watersurvey
DROP CONSTRAINT FWEL_waters_landu_water_fk;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop tables ***************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEL_energysurvey
-- --------------------------------------------------------------------
DROP TABLE FWEL_energysurvey;
-- --------------------------------------------------------------------
-- FWEL_foodsurvey
-- --------------------------------------------------------------------
DROP TABLE FWEL_foodsurvey;
-- --------------------------------------------------------------------
-- FWEL_land_use
-- --------------------------------------------------------------------
DROP TABLE FWEL_land_use;
-- --------------------------------------------------------------------
-- FWEL_landusesurvey
-- --------------------------------------------------------------------
DROP TABLE FWEL_landusesurvey;
-- --------------------------------------------------------------------
-- FWEL_watersurvey
-- --------------------------------------------------------------------
DROP TABLE FWEL_watersurvey;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop Sequences *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PURGE RECYCLEBIN;
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:54:48
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Enable Versioning **********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exec DBMS_WM.EnableVersioning('FWEL_energysurvey,FWEL_foodsurvey,FWEL_land_use,FWEL_landusesurvey,FWEL_watersurvey,','VIEW_WO_OVERWRITE');
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:54:48
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create tables **************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEL_energysurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEL_energysurvey
(
id INTEGER NOT NULL,
biomassprimaryenergypotent_1 VARCHAR(1000),
biomassprimaryenergypotentia NUMERIC,
biomasstobioethanol NUMERIC,
biomasstobioethanolunit VARCHAR(1000),
biomasstobiogas NUMERIC,
biomasstobiogasunit VARCHAR(1000),
biomasstoelectricitypotent_1 VARCHAR(1000),
biomasstoelectricitypotentia NUMERIC,
biomasstoenergywoods NUMERIC,
biomasstoenergywoodsunit VARCHAR(1000),
biomasstoplantoil NUMERIC,
biomasstoplantoilunit VARCHAR(1000),
biomasstoresidualsolidfuel NUMERIC,
biomasstoresidualsolidfuelun VARCHAR(1000),
biomasstosolidfuel NUMERIC,
biomasstosolidfuelunit VARCHAR(1000),
biomasstothermalpotential NUMERIC,
biomasstothermalpotentialuni VARCHAR(1000),
electricitypotentialfrompv_1 VARCHAR(1000),
electricitypotentialfrompvbu NUMERIC,
landusesurve_energysurvey_id INTEGER,
residentialelectricitydema_1 VARCHAR(1000),
residentialelectricitydemand NUMERIC,
spacecoolingdemand NUMERIC,
spacecoolingdemandunit VARCHAR(1000),
spaceheatingdemand NUMERIC,
spaceheatingdemandunit VARCHAR(1000),
vegetationcovercat_codespace VARCHAR(1000),
vegetationcovercategory VARCHAR(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEL_foodsurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEL_foodsurvey
(
id INTEGER NOT NULL,
foodcategory VARCHAR(1000),
foodcategory_codespace VARCHAR(1000),
foodconsumption NUMERIC,
foodconsumptionunit VARCHAR(1000),
fooddemand NUMERIC,
fooddemandunit VARCHAR(1000),
foodproduction NUMERIC,
foodproductionenergydemand NUMERIC,
foodproductionengerydemandun VARCHAR(1000),
foodproductionunit VARCHAR(1000),
foodproductionwaterdemand NUMERIC,
foodproductionwaterdemanduni VARCHAR(1000),
landusesurvey_foodsurvey_id INTEGER,
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEL_land_use
-- --------------------------------------------------------------------
CREATE TABLE FWEL_land_use
(
id INTEGER NOT NULL,
fweareaname VARCHAR(1000),
fwesystemname VARCHAR(1000),
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEL_landusesurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEL_landusesurvey
(
id INTEGER NOT NULL,
buildingfootprintarea NUMERIC,
buildingfootprintarea_uom VARCHAR(1000),
land_use_consistsoffwesur_id INTEGER,
objectclass_id INTEGER,
population INTEGER,
surfacearea NUMERIC,
surfacearea_uom VARCHAR(1000),
surveydescription VARCHAR(1000),
surveyyear INTEGER,
surveyyearversion NUMERIC,
PRIMARY KEY (id)
);
-- --------------------------------------------------------------------
-- FWEL_watersurvey
-- --------------------------------------------------------------------
CREATE TABLE FWEL_watersurvey
(
id INTEGER NOT NULL,
domestichotwaterdemand NUMERIC,
domestichotwaterdemandunit VARCHAR(1000),
domestichotwaterenergydema_1 VARCHAR(1000),
domestichotwaterenergydemand NUMERIC,
domesticsolidwaste NUMERIC,
domesticsolidwasteunit VARCHAR(1000),
domesticwaterdemand NUMERIC,
domesticwaterdemandunit VARCHAR(1000),
domesticwaterwaste NUMERIC,
domesticwaterwasteunit VARCHAR(1000),
landusesurvey_watersurvey_id INTEGER,
totaldomesticwaste NUMERIC,
totaldomesticwasteunit VARCHAR(1000),
PRIMARY KEY (id)
);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create foreign keys ********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEL_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_energysurvey ADD CONSTRAINT FWEL_energysurvey_fk FOREIGN KEY (id)
REFERENCES FWEL_landusesurvey (id);
ALTER TABLE FWEL_energysurvey ADD CONSTRAINT FWEL_energy_landu_energ_fk FOREIGN KEY (landusesurve_energysurvey_id)
REFERENCES FWEL_landusesurvey (id);
-- --------------------------------------------------------------------
-- FWEL_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_foodsurvey ADD CONSTRAINT FWEL_foodsurvey_fk FOREIGN KEY (id)
REFERENCES FWEL_landusesurvey (id);
ALTER TABLE FWEL_foodsurvey ADD CONSTRAINT FWEL_foodsu_landu_foods_fk FOREIGN KEY (landusesurvey_foodsurvey_id)
REFERENCES FWEL_landusesurvey (id);
-- --------------------------------------------------------------------
-- FWEL_land_use
-- --------------------------------------------------------------------
ALTER TABLE FWEL_land_use ADD CONSTRAINT FWEL_land_use_fk FOREIGN KEY (id)
REFERENCES land_use (id);
-- --------------------------------------------------------------------
-- FWEL_landusesurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_landusesurvey ADD CONSTRAINT FWEL_landusesurvey_fk FOREIGN KEY (id)
REFERENCES cityobject (id);
ALTER TABLE FWEL_landusesurvey ADD CONSTRAINT FWEL_landusesu_objectcl_fk FOREIGN KEY (objectclass_id)
REFERENCES objectclass (id);
ALTER TABLE FWEL_landusesurvey ADD CONSTRAINT FWEL_land_land_use_cons_fk FOREIGN KEY (land_use_consistsoffwesur_id)
REFERENCES FWEL_land_use (id);
-- --------------------------------------------------------------------
-- FWEL_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_watersurvey ADD CONSTRAINT FWEL_watersurvey_fk FOREIGN KEY (id)
REFERENCES FWEL_landusesurvey (id);
ALTER TABLE FWEL_watersurvey ADD CONSTRAINT FWEL_waters_landu_water_fk FOREIGN KEY (landusesurvey_watersurvey_id)
REFERENCES FWEL_landusesurvey (id);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Indexes *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEL_energysurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEL_energ_landu_energ_fkx ON FWEL_energysurvey
USING btree
(
landusesurve_energysurvey_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- --------------------------------------------------------------------
-- FWEL_foodsurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEL_foods_landu_foods_fkx ON FWEL_foodsurvey
USING btree
(
landusesurvey_foodsurvey_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- --------------------------------------------------------------------
-- FWEL_landusesurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEL_land_land_use_con_fkx ON FWEL_landusesurvey
USING btree
(
land_use_consistsoffwesur_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
CREATE INDEX FWEL_landuses_objectcl_fkx ON FWEL_landusesurvey
USING btree
(
objectclass_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- --------------------------------------------------------------------
-- FWEL_watersurvey
-- --------------------------------------------------------------------
CREATE INDEX FWEL_water_landu_water_fkx ON FWEL_watersurvey
USING btree
(
landusesurvey_watersurvey_id ASC NULLS LAST
) WITH (FILLFACTOR = 90);
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Create Sequences ***********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- This document was automatically created by the ADE-Manager tool of 3DCityDB (https://www.3dcitydb.org) on 2021-01-10 14:54:48
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop foreign keys **********************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEL_energysurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_energysurvey
DROP CONSTRAINT FWEL_energysurvey_fk;
ALTER TABLE FWEL_energysurvey
DROP CONSTRAINT FWEL_energy_landu_energ_fk;
-- --------------------------------------------------------------------
-- FWEL_foodsurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_foodsurvey
DROP CONSTRAINT FWEL_foodsurvey_fk;
ALTER TABLE FWEL_foodsurvey
DROP CONSTRAINT FWEL_foodsu_landu_foods_fk;
-- --------------------------------------------------------------------
-- FWEL_land_use
-- --------------------------------------------------------------------
ALTER TABLE FWEL_land_use
DROP CONSTRAINT FWEL_land_use_fk;
-- --------------------------------------------------------------------
-- FWEL_landusesurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_landusesurvey
DROP CONSTRAINT FWEL_landusesurvey_fk;
ALTER TABLE FWEL_landusesurvey
DROP CONSTRAINT FWEL_landusesu_objectcl_fk;
ALTER TABLE FWEL_landusesurvey
DROP CONSTRAINT FWEL_land_land_use_cons_fk;
-- --------------------------------------------------------------------
-- FWEL_watersurvey
-- --------------------------------------------------------------------
ALTER TABLE FWEL_watersurvey
DROP CONSTRAINT FWEL_watersurvey_fk;
ALTER TABLE FWEL_watersurvey
DROP CONSTRAINT FWEL_waters_landu_water_fk;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop tables ***************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- --------------------------------------------------------------------
-- FWEL_energysurvey
-- --------------------------------------------------------------------
DROP TABLE FWEL_energysurvey;
-- --------------------------------------------------------------------
-- FWEL_foodsurvey
-- --------------------------------------------------------------------
DROP TABLE FWEL_foodsurvey;
-- --------------------------------------------------------------------
-- FWEL_land_use
-- --------------------------------------------------------------------
DROP TABLE FWEL_land_use;
-- --------------------------------------------------------------------
-- FWEL_landusesurvey
-- --------------------------------------------------------------------
DROP TABLE FWEL_landusesurvey;
-- --------------------------------------------------------------------
-- FWEL_watersurvey
-- --------------------------------------------------------------------
DROP TABLE FWEL_watersurvey;
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- *********************************** Drop Sequences *************************************
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment