Index creation silently dropped when referencing relation
Issue #2380
resolved
(original reporter: rbu) SQLAlchemy (0.7.2 here) silently ignores Index() declarations when they do not reference a proper column when it should at least issue a warning (if not even find out the related column).
For example, with a declarative model such as this:
class Fnord(Base):
__tablename__ = 'fnord'
id = Column(Integer, primary_key=True)
other_id = Column(Integer, ForeignKey(Other.id))
other = relationship(Other)
this will create an index:
Index("ix_fnord_other", Fnord.other_id)
but this will not:
Index("ix_fnord_other", Fnord.other)
Even nonsensical statements such as
Index("ix_fnord_other")
do not create at least a warning.
Comments (3)
-
repo owner -
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.7.6 (automated comment)
- Log in to comment
here's a patch:
tests to add are:
}}}