[Sqlalchemy-tickets] Issue #3216: Don't create serial column when there's more than one PK column (
Brought to you by:
zzzeek
|
From: thiefmaster <iss...@bi...> - 2014-10-01 07:21:31
|
New issue 3216: Don't create serial column when there's more than one PK column https://bitbucket.org/zzzeek/sqlalchemy/issue/3216/dont-create-serial-column-when-theres-more thiefmaster: E.g. in this example: ``` class Foo(Base): __tablename__ = 'foo' id1 = Column(Integer, primary_key=True, nullable=False) id2 = Column(Integer, primary_key=True, nullable=False) ``` I believe it does not make much sense to create `id1` as autoincrement/serial while `id2` is a plain integer columns. Unless there are database engines which actually support multiple serial columns, I would either disable autoincrement for both columns in that case or raise an error, forcing the user to enable/disable autoincrement explictly. |