`--auto` does not know fields from the Peewee Playhouse
We are using the BinaryJSONField from the Playhouse module for PostgreSQL (see http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#postgres-ext).
The migrations file contains then the following:
@migrator.create_model
class Result(pw.Model):
energy = pw.DoubleField()
task = pw.ForeignKeyField(db_column='task_id', rel_model=Task, to_field='id')
filename = pw.CharField(max_length=255, null=True)
data = pw.BinaryJSONField(index=True, null=True)
while it should maybe be something like:
import playhouse.postgres_ext as pw_pext
[...]
@migrator.create_model
class Result(pw.Model):
energy = pw.DoubleField()
task = pw.ForeignKeyField(db_column='task_id', rel_model=Task, to_field='id')
filename = pw.CharField(max_length=255, null=True)
data = pw_pext.BinaryJSONField(index=True, null=True)
In the original models file I have:
from playhouse.postgres_ext import BinaryJSONField
Same happens for me when using muffin_peewee.
I have from muffin_peewee import JSONField in models yet migration too ends up having pw.JSONField.
It's not hard to manually change the migration but it would be awesome if it would automatically recognize to what a field belongs to. (maybe using inspect? I don't know specific inner workings of this library to give any more suggestions.)
Bump, will this be addressed in any way? Should we just create migrations manually?
I have made a quick pr to fix this problem: https://github.com/klen/peewee_migrate/pull/56