'Re-enable foreign key checks after they have been disabled.'

def enable_constraint_checking(self):

    (self.needs_rollback, needs_rollback) = (False, self.needs_rollback)
    try:
        self.cursor().execute(u'SET    foreign_key_checks=1')
    finally:
        self.needs_rollback = needs_rollback
