Skip to content

Second migration alter my primary key #953

Discussion options

You must be logged in to vote

Hi,

The issue seems to be that you are setting nullable=True on a primary key in the sqlalchemy table.
Postgresql does not support that: https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-PRIMARY-KEYS

Alembic is seeing a difference there and is trying to set the column nullable.

To solve this you should remove nullable=True from the table definition

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@movaldivia
Comment options

Answer selected by CaselIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #952 on October 14, 2021 21:59.