Foreign Key creation during create_table does not use reference field length
What exactly is the error you are encountering? The linked ticket does not strike me as being relevant.

How is this varchar foreign-key field being declared? How is the field it is pointing to declared? ```python
class ReleaseASINMap(BaseModel):
    release_id = peewee.CharField(max_length=51, unique=True, null=True)

class ReverseStringMap(BaseModel):
    release_map = peewee.ForeignKeyField(ReleaseASINMap, field="release_id", 
            backref='reverse_map',
            on_delete="CASCADE")

peewee.InternalError: (1005, u"Can't create table 'repricer.reverse_string_map' (errno: 150)"
```
Maybe I'm on to nothing here. It did work on my local, not in production, and by googling I see the #150 error is related to foreign keys. Note: please format your code in the future. For fuck's sake it is not hard. The errno: 150 is coming from MySQL - not Peewee... So if I look at the generated SQL for the CREATE TABLE query looks OK to me:

```sql
CREATE TABLE IF NOT EXISTS `reverse_string_map` (
  `id` INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY, 
  `release_map_id` VARCHAR(51) NOT NULL, 
  FOREIGN KEY (`release_map_id`) 
      REFERENCES `release_asin_map` (`release_id`) 
      ON DELETE CASCADE)
```

You may want to check your MySQL manual, verify the storage engine you are using (you need InnoDB), etc, etc. This SO answer may help:

https://stackoverflow.com/questions/1457305/mysql-creating-tables-with-foreign-keys-giving-errno-150 The following code works fine for me and does not produce any error, so I'll suggest you've got some problem on your side and that this isn't a bug in Peewee:

```python
from peewee import *

db = MySQLDatabase('peewee_test')

class BaseModel(Model):
    class Meta:
        legacy_table_names = False
        database = db

class ReleaseASINMap(BaseModel):
    release_id = CharField(max_length=51, unique=True, null=True)

class ReverseStringMap(BaseModel):
    release_map = ForeignKeyField(ReleaseASINMap, field="release_id",
            backref='reverse_map',
            on_delete="CASCADE")

db.create_tables([ReleaseASINMap, ReverseStringMap])
db.drop_tables([ReleaseASINMap, ReverseStringMap])
``` Noted the issue. It was with the collations difference. Database itself is on latin1 collation, some tables are on utf8. Thanks for that.
I have a table using InnoDB engine in MySQL. The field I want to reference is a varchar of 51. 
Using the create_table or create_tables([Table]) syntax to create it, the created foreign key field is varchar of 255, leading an error #150.