~openupgrade-committers/openupgrade-server/5.0

« back to all changes in this revision

Viewing changes to bin/tools/sql.py

  • Committer: Stefan Rijnhart
  • Date: 2012-05-27 12:24:43 UTC
  • mfrom: (2175.1.3 openupgrade-server)
  • Revision ID: stefan@therp.nl-20120527122443-7lh1cvrm26wt8u6e
[MRG] Add openupgrade development module for easy analysis file generation

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
def drop_view_if_exists(cr, viewname):
24
24
    cr.execute("select count(1) from pg_class where relkind=%s and relname=%s", ('v', viewname,))
25
25
    if cr.fetchone()[0]:
26
 
        cr.execute("DROP view %s" % (viewname,))
 
26
        # OpenUpgrade: add CASCADE
 
27
        cr.execute("DROP view %s CASCADE" % (viewname,))
27
28
        cr.commit()
28
29
 
29
30
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: