     description VARCHAR,
     last_update timestamp without time zone
         DEFAULT timezone('UTC'::text, now()) NOT NULL
-) TABLESPACE pshai_ts;
-SELECT AddGeometryColumn('pshai', 'fault_edge', 'top', 4326, 'LINESTRING', 3);
-SELECT AddGeometryColumn('pshai', 'fault_edge', 'bottom', 4326, 'LINESTRING', 3);
-ALTER TABLE pshai.fault_edge ALTER COLUMN top SET NOT NULL;
-ALTER TABLE pshai.fault_edge ALTER COLUMN bottom SET NOT NULL;
+) TABLESPACE hzrdi_ts;
+SELECT AddGeometryColumn('hzrdi', 'fault_edge', 'top', 4326, 'LINESTRING', 3);
+SELECT AddGeometryColumn('hzrdi', 'fault_edge', 'bottom', 4326, 'LINESTRING', 3);
+ALTER TABLE hzrdi.fault_edge ALTER COLUMN top SET NOT NULL;
+ALTER TABLE hzrdi.fault_edge ALTER COLUMN bottom SET NOT NULL;
 
 
 -- complex source view, needed for Opengeo server integration
-CREATE VIEW pshai.complex_source (
+CREATE VIEW hzrdi.complex_source (
     id, owner_id, input_id, gid, name, description, si_type, tectonic_region,
     rake, top_edge, bottom_edge, fault_outline) AS
 SELECT

    r_depth_distr_id INTEGER,
    last_update timestamp without time zone
        DEFAULT timezone('UTC'::text, now()) NOT NULL
) TABLESPACE pshai_ts;
SELECT AddGeometryColumn('pshai', 'source', 'point', 4326, 'POINT', 2);
SELECT AddGeometryColumn('pshai', 'source', 'area', 4326, 'POLYGON', 2);


-- Simple fault geometry
CREATE TABLE pshai.simple_fault (
    id SERIAL PRIMARY KEY,
    owner_id INTEGER NOT NULL,
    -- gml:id

    rup.si_type, rup.tectonic_region, rup.rake, rup.magnitude,
    rup.magnitude_type, fedge.top, fedge.bottom, cfault.outline
FROM
    hzrdi.rupture rup, hzrdi.complex_fault cfault, hzrdi.fault_edge fedge
WHERE
    rup.si_type = 'complex'
    AND rup.complex_fault_id = cfault.id AND cfault.fault_edge_id = fedge.id;


-- Rupture depth distribution
CREATE TABLE hzrdi.r_depth_distr (
    id SERIAL PRIMARY KEY,
    owner_id INTEGER NOT NULL,
    -- gml:id
