Skip to content

When I use sa.Identity() in my table - sqla-history version table doesnt work with alembic #86

@AbdealiLoKo

Description

@AbdealiLoKo

If I have a table like:

import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()

class Article(Base):
    __tablename__ = 'article'

    id = sa.Column(sa.Integer, sa.Identity(), primary_key=True, autoincrement=True)
    name = sa.Column(sa.String(255))

When I add __versioned__ = {} to add it to sqla-history, I get the following issue with alembic autogeneration:

sqlalchemy.exc.ArgumentError: A column with an Identity object cannot specify autoincrement=False

Metadata

Metadata

Assignees

No one assigned

    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