SELECT for_vrevisions('
CREATE OR REPLACE VIEW vrevisions_trunk.complex_objects_slaves_view AS
 SELECT r.master_id,
    r.slave_id AS id,
    r.domain_attrs -> ''rel:slave''::text AS slave_category,
    r.domain_attrs -> ''rel:role''::text AS slave_role,
    s.the_geom,
    r.domain_attrs -> ''rel:master''::text AS master_category
   FROM vrevisions_trunk.objects_r r,
    vrevisions_trunk.objects s
  WHERE r.slave_id = s.id AND s.the_geom IS NOT NULL;
');
