Peewee: UnsignedIntegerField?

Created on 6 Mar 2015  路  6Comments  路  Source: coleifer/peewee

Hi,

I'm trying to create a model with an unsigned integer field but I can't find how to do it with peewee.

Is this possible?

Most helpful comment

got this one worked:

class UnsignedIntegerField(IntegerField):
    field_type = 'int unsigned'

(peewee 3.3.4)

All 6 comments

if you got here through google - like me - here is a quick solution which worked for my use case
uid = SmallIntegerField(null=True, constraints=[SQL("UNSIGNED")])

:+1: thanks for sharing @sooslaca

got this one worked:

class UnsignedIntegerField(IntegerField):
    field_type = 'int unsigned'

(peewee 3.3.4)

@sooslaca
it doesn't work as you said.

You can use @binderclip snippet, which works for Peewee 3.x and newer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  5Comments

rayzorben picture rayzorben  路  4Comments

razodactyl picture razodactyl  路  3Comments

GMaxera picture GMaxera  路  4Comments

alexlatchford picture alexlatchford  路  4Comments