[Sqlalchemy-tickets] Issue #3273: check constraint missing in the reflected metadata for firebird (
Brought to you by:
zzzeek
|
From: florent b. <iss...@bi...> - 2014-12-15 07:06:33
|
New issue 3273: check constraint missing in the reflected metadata for firebird https://bitbucket.org/zzzeek/sqlalchemy/issue/3273/check-constraint-missing-in-the-reflected florent breheret: python 2.7.8, firebird 2.5.3, sqlalchemy 0.9.8, fdb 1.4.3 For a table with a check constraint, I noticed that this check constraint is missing in the reflected metadata. The test case to reproduce: import unittest from sqlalchemy import * class TestSuite(unittest.TestCase): def setUp(self): self.engine = create_engine('firebird+fdb://SYSDBA:masterkey@/c:/unitest.fdb') self.connection = self.engine.connect() def tearDown(self): self.connection.execute("DROP TABLE TMP_TABLE") self.connection.close() def test_check_constraint_reflected(self): table = Table('TMP_TABLE', MetaData(bind=self.connection), Column('dt', Integer), CheckConstraint('dt > 1') ) table.create(self.engine) reflected_constraints = MetaData(bind=self.connection, reflect=True).tables['tmp_table'].constraints self.assertItemsEqual( [c.__class__.__name__ for c in table.constraints], [c.__class__.__name__ for c in reflected_constraints] ) if __name__ == '__main__': unittest.main() |