def get_num_attachments(connection):
    """Get the number of attachments that need to be migrated"""
    with connection.cursor() as cursor:
        cursor.execute("SELECT COUNT(*) FROM form_processor_xformattachmentsql")
        return cursor.fetchone()[0]