Primary + unique constraint on same migration #1494
Unanswered
Gildraen
asked this question in
Usage Questions
Replies: 2 comments 8 replies
-
Hi, I'm not sure what you are asking here. The generated migration is correct, so I'm not sure what you are look for |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Hi, when i want to create a table with a column that has primary AND unique:
id: MappedColumn[UUID] = mapped_column( UserIdType(as_uuid=True), primary_key=True, unique=True, nullable=False )
the migration generated seems good:
op.create_table( "users", sa.Column("id", UserIdType(), nullable=False), sa.PrimaryKeyConstraint("id"), sa.UniqueConstraint("id"), )
but it does not create the uniq index.. i only have the primary index
Expected behavior
The creation of the table, with the primary index and the unique index on the same migration
To Reproduce
Versions.
Have a nice day!
Beta Was this translation helpful? Give feedback.
All reactions