[Sqlalchemy-tickets] Issue #3166: autoincrement should not be True for non-integer primary key (zzz
Brought to you by:
zzzeek
|
From: lieryan <iss...@bi...> - 2014-08-15 03:20:36
|
New issue 3166: autoincrement should not be True for non-integer primary key https://bitbucket.org/zzzeek/sqlalchemy/issue/3166/autoincrement-should-not-be-true-for-non lieryan: The behavior of autoincrement attribute is misleading when the primary key is not an integer primary key. Test case: ``` #!python from sqlalchemy import Column, String from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Table(Base): __tablename__ = 'table' code = Column(String(50), primary_key = True) table = Base.metadata.tables['table'] pk_column = table.primary_key.columns['code'] assert not pk_column.autoincrement ``` |