Skip to content

Alembic not creating index with BigInteger sa_column type #554

Answered by YuriiMotov
robcxyz asked this question in Questions
Discussion options

You must be logged in to vote

When you use sa_*** parameters, it hides other column-related parameters like index, unique, primary_key, ..
You need to pass these parameters to Column instead:

    not_indexed_in_alembic: int = Field(
        None,
        # index=True, <- this will not work
        sa_column=Column(BigInteger(), index=True)  # <- pass column-related parameters here
    )

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
3 participants