Now checks if the token_ranges table exists before trying to delete existing ranges