Skip to content

Postgresql primary key is Int4, not Int8 #519

Description

@connrs

Hi there,

I'm very new to the Yesod project, so I do apologise if I've missed something here. I've really enjoyed reading about this framework and I was experimenting with setting up the database (Postgres) tables in config/models; after setting up some models, I noticed that the primary key was Int4 but arbitrary columns set as Int would be created as Int8.

I took a look around the codebase and spotted that "SERIAL" is defined on line 491 of Postgresql.hs. The serial column type creates an Int4 column, whereas bigserial/serial8 creates an Int8 column. It's currently causing me problems when defining foreign keys as the column types aren't matching.

I took a look around the documentation and found nothing about this in the wiki or the Yesod Web Framework Book. I took a look around the existing issues and issue #455 looked vaguely similar, but I wanted to raise a new query just in case. Is there a configuration option that I've missed here or some documentation that I've missed?

Thanks,
connrs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions