gem/oq-engine — pull request #1015 by micheles (2013-01-26 13:32:33+00:00)
Title: Simplify the data model for the scenario_damage risk calculator

The challenge here is to remove several tables (including the corresponding Django models and tests, and including several triggers) without losing any important functionality.
This pull requests merges

DmgDistPerAsset and DmgDistPerAssetData
DmgDistPerTaxonomy and DmgDistPerTaxonomyData
DmgDistTotal and DmgDistTotalData

removes

CollapseMap and CollapseMapData

and adds

DmgState

Foreign keys to DmgState are added to make sure that only valid damage_states can enter in the database: this allows to remove several complex triggers in PLPython.
The tests of consistency have been updated accordingly.

Moreover all the tables related to the FragilityModel (and models and tests) have been removed, by following the new paradigm introduced for the VulnerabilityModel.

In total 8 tables are removed and 1 added.