lib/updateable_views_inheritance/postgresql_adapter.rb
# Recursively delete +parent_relation+ (if it is a view) and the children views the depend on it.
Recursively delete +parent_relation+ (if it is a view) and the children views the depend on it.
Recursively delete + parent_relation + ( if it is a view ) and the children views the depend on it .
def remove_parent_and_children_views(parent_relation)
          children_views = query(<<-end_sql).map{|row| row[0]}
            SELECT child_aggregate_view
              FROM updateable_views_inheritance
             WHERE parent_relation = '#{parent_relation}'
          end_sql
          children_views.each do |cv|
            remove_parent_and_children_views(cv)
            drop_view(cv) if is_view?(cv)
          end
          drop_view(parent_relation) if is_view?(parent_relation)
        end
def remove_parent_and_children_views ( parent_relation ) children_views = query ( <<-end_sql ) . map { | row | row [ 0 ] } 
            SELECT child_aggregate_view
              FROM updateable_views_inheritance
             WHERE parent_relation = ' #{ parent_relation } '
           end_sql children_views . each do | cv | remove_parent_and_children_views ( cv ) drop_view ( cv ) if is_view? ( cv ) end drop_view ( parent_relation ) if is_view? ( parent_relation ) end
Recursively delete +parent_relation+ (if it is a view) and the children views the depend on it.
Recursively delete + parent_relation + ( if it is a view ) and the children views the depend on it .
# drop the view only if it wasn't dropped beforehand in recursive call from other method.
parent_relation
<not_specific>