(self, dst_db, table_name)
Drop all foreign keys to and from this table.

        They need to be dropped one at a time to avoid deadlocks with user code.
Drop all foreign keys to and from this table.
Drop all foreign keys to and from this table .
def drop_fkeys(self, dst_db, table_name):
        """Drop all foreign keys to and from this table.

        They need to be dropped one at a time to avoid deadlocks with user code.
        """

        dst_curs = dst_db.cursor()
        q = "select * from londiste.find_table_fkeys(%s)"
        dst_curs.execute(q, [table_name])
        fkey_list = dst_curs.fetchall()
        for row in fkey_list:
            self.log.info('Dropping fkey: %s' % row['fkey_name'])
            q2 = "select londiste.drop_table_fkey(%(from_table)s, %(fkey_name)s)"
            dst_curs.execute(q2, row)
            dst_db.commit()
def drop_fkeys ( self , dst_db , table_name ) : dst_curs = dst_db . cursor ( ) q = "select * from londiste.find_table_fkeys(%s)" dst_curs . execute ( q , [ table_name ] ) fkey_list = dst_curs . fetchall ( ) for row in fkey_list : self . log . info ( 'Dropping fkey: %s' % row [ 'fkey_name' ] ) q2 = "select londiste.drop_table_fkey(%(from_table)s, %(fkey_name)s)" dst_curs . execute ( q2 , row ) dst_db . commit ( )