We don't refer consider table_name when creating versioned class, so need to look into a better configuration option or a patchy fix that we did in #69
from sqlalchemy_history import make_versioned, version_class
from sqlalchemy import Column, Integer, Unicode, UnicodeText
from sqlalchemy.orm import declarative_base
from sqlalchemy.orm import configure_mappers
make_versioned(user_cls=None, options={"table_name": "%s_user_defined"})
Base = declarative_base()
class Article(Base):
__versioned__ = {}
__tablename__ = 'article'
id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(Unicode(255))
content = Column(UnicodeText)
configure_mappers()
print(Article)
print(version_class(Article)) # Gives ArticleVersion but it should have been ArticleUserDefined
We don't refer consider table_name when creating versioned class, so need to look into a better configuration option or a patchy fix that we did in #69