peewee_migrate icon indicating copy to clipboard operation
peewee_migrate copied to clipboard

Every fields with default value are considered changed.

Open trim21 opened this issue 6 years ago • 3 comments

I'm not quite sure that is my mistake or its a bug of peewee_migrate.

image

left is my first migration, and i didn't change followed table, but edited another table. Then I generated a migration.

But i found that pw.CharField and pw.InteferField are both consider changed. Seems that all field with default value are considered changed and automatically get a migration.

trim21 avatar May 17 '19 19:05 trim21

Found workaround. Manually replace onstraints=[SQL("DEFAULT 0")] with default=0, and the migrate will work as excpted.

trim21 avatar May 17 '19 21:05 trim21

I'm not quite sure that is my mistake or its a bug of peewee_migrate.

image

left is my first migration, and i didn't change followed table, but edited another table. Then I generated a migration.

But i found that pw.CharField and pw.InteferField are both consider changed. Seems that all field with default value are considered changed and automatically get a migration.

I encounter the same problem。It is a bug,the default value show not generate "constraints" param,but generate "default" param

zhjchina avatar Aug 27 '19 06:08 zhjchina

@zhjchina I try pwiz in peewee package, it has same behavior.

trim21 avatar Aug 27 '19 06:08 trim21