Issue: Fixed renaming unique foreign key in MySQL
Author: dext0r
State: closed
Created: 2016-12-03 15:25:00

When i trying to rename unique foreign key in MySQL, i got error: 
`peewee.OperationalError: (1091, "Can't DROP '...'; check that column/key exists")`

Here is a demo code:
```python
# coding: utf8
import logging

from peewee import MySQLDatabase, Model, ForeignKeyField, IntegerField
from playhouse.migrate import MySQLMigrator, migrate

db = MySQLDatabase(host='prl-s.shared', user='root', database='test')

logger = logging.getLogger('peewee')
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())


class ModelA(Model):
    class Meta:
        database = db


class ModelB(Model):
    a = ForeignKeyField(ModelA, unique=True)

    class Meta:
        database = db

db.connect()
db.execute_sql('drop table if exists modelb, modela')
ModelA.create_table()
ModelB.create_table()

migrator = MySQLMigrator(db)
migrate(
    migrator.rename_column('modelb', 'a_id', 'a_id_renamed')
)
```

Output:
```
('drop table if exists modelb, modela', None)
('CREATE TABLE `modela` (`id` INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY)', [])
('CREATE TABLE `modelb` (`id` INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY, `a_id` INTEGER NOT NULL, `foo` INTEGER, FOREIGN KEY (`a_id`) REFERENCES `modela` (`id`))', [])
('CREATE UNIQUE INDEX `modelb_a_id` ON `modelb` (`a_id`)', [])
('\n            SELECT column_name, referenced_table_name, referenced_column_name\n            FROM information_schema.key_column_usage\n            WHERE table_name = %s\n                AND table_schema = DATABASE()\n                AND referenced_table_name IS NOT NULL\n                AND referenced_column_name IS NOT NULL', ('modelb',))
('DESCRIBE modelb;', None)
('SELECT constraint_name FROM information_schema.key_column_usage WHERE table_schema = DATABASE() AND table_name = %s AND column_name = %s;', ('modelb', 'a_id'))
(u'ALTER TABLE `modelb` DROP FOREIGN KEY `modelb_a_id`', [])
Traceback (most recent call last):
  File '_.py", line 33, in <module>
    migrator.rename_column('modelb', 'a_id', 'a_id_renamed')
  File "/peewee/playhouse/migrate.py", line 711, in migrate
    operation.run()
  File "/peewee/playhouse/migrate.py", line 144, in run
    getattr(self.migrator, self.method)(*self.args, **kwargs))
  File "/peewee/playhouse/migrate.py", line 138, in _handle_result
    self._handle_result(item)
  File "/peewee/playhouse/migrate.py", line 135, in _handle_result
    result.run()
  File "/peewee/playhouse/migrate.py", line 144, in run
    getattr(self.migrator, self.method)(*self.args, **kwargs))
  File "/peewee/playhouse/migrate.py", line 133, in _handle_result
    self.execute(result)
  File "/peewee/playhouse/migrate.py", line 129, in execute
    self.migrator.database.execute_sql(sql, params)
  File "/peewee/peewee.py", line 3714, in execute_sql
    self.commit()
  File "/peewee/peewee.py", line 3537, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/peewee/peewee.py", line 3707, in execute_sql
    cursor.execute(sql, params or ())
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
peewee.OperationalError: (1091, "Can't DROP 'modelb_a_id'; check that column/key exists")
```

This pull request fixes that. Though I'm not sure if i wrote a test case correctly.

gametight, thanks!