check constraint missing in the reflected metadata for firebird

Issue #3273 duplicate
florent florent created an issue

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()

Comments (3)

  1. Log in to comment