Have you ever found yourself in a situation where your text formats (e.g. "full_html" or "plain_text") ended up with wrong names or even numbers? This happened to me more than once, mainly for Drupal sites that got upgraded from Drupal 6 to 7.
The script here renames all the formats in all relevant tables.
drush scr rename-text-formats.php 'old1=>new1' 'old2=>new2' ... 'oldn=>newn'
Please backup your Drupal database before you're going to use this script!