Default value for peewee DoubleField doesn't get reflected in MySQL db Default value for peewee DoubleField doesn't get reflected in MySQL db flask flask

Default value for peewee DoubleField doesn't get reflected in MySQL db


The difference is only enforced on the Python side -- so if you're expecting the server to enforce the default you'll need to use a constraint:

percentage = peewee.DoubleField(constraints=[SQL('DEFAULT 0.0')])

Docs: http://docs.peewee-orm.com/en/latest/peewee/models.html#default-field-values