Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

peewee.ProgrammingError: column is of type integer[] but expression is of type record #102

Open
rominf opened this issue Sep 3, 2018 · 0 comments

Comments

@rominf
Copy link

rominf commented Sep 3, 2018

I want to change the default for ArrayField. I have following lines in my migration (simplified):

def migrate(migrator, db, fake=False, **kwargs):
    """Write your migrations here."""
    _, _ = fake, kwargs

    class Postfilter(BaseModel):
        actions = ArrayField(IntegerField, default=[2, 4, 11])

    db_proxy.initialize(db)
    migrator.orm['postfilter'] = Postfilter
    migrator.add_default('postfilter', 'actions', [10, 2, 4, 11])

Migration fails:

...
peewee.ProgrammingError: column "actions" is of type integer[] but expression is of type record
LINE 1: UPDATE "postfilter" SET "actions" = (10, 2, 4, 11)
                                            ^
HINT:  You will need to rewrite or cast the expression.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant