Peewee: text field type when using mysql/mariadb database

Created on 1 Nov 2018  路  1Comment  路  Source: coleifer/peewee

Hi,

According to the documentation, TextField should use MySQL longtext column type but it uses the text column type. Is this the desired behavior and the documentation has not been changed? If so, how can I change my code to make sure it uses a longtext and not a text field type?

Most helpful comment

Apologies -- the docs are incorrect. Peewee used "longtext" up until 3.x, at which point it changed to just plain old "text".

To have a longtext field:

class LongTextField(TextField):
    field_type = 'LONGTEXT'

Then just use it as you would a regular TextField.

>All comments

Apologies -- the docs are incorrect. Peewee used "longtext" up until 3.x, at which point it changed to just plain old "text".

To have a longtext field:

class LongTextField(TextField):
    field_type = 'LONGTEXT'

Then just use it as you would a regular TextField.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vkrizan picture vkrizan  路  3Comments

christianmalek picture christianmalek  路  4Comments

alexpantyukhin picture alexpantyukhin  路  5Comments

megachweng picture megachweng  路  3Comments

mikemill picture mikemill  路  3Comments