From: Mike Bayer Date: Tue, 4 Oct 2011 16:30:23 +0000 (-0400) Subject: add a test to confirm alter table of pk column gets reflected X-Git-Tag: rel_0_7_3~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=771f6fba4c76d4c65c4326cbbc5ce1d909d7358a;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add a test to confirm alter table of pk column gets reflected --- diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py index 8f90becd59..b37344b279 100644 --- a/test/dialect/test_postgresql.py +++ b/test/dialect/test_postgresql.py @@ -1316,6 +1316,17 @@ class ReflectionTest(fixtures.TestBase): r = t3.insert().execute() eq_(r.inserted_primary_key, [2]) + @testing.provide_metadata + def test_renamed_pk_reflection(self): + metadata = self.metadata + t = Table('t', metadata, Column('id', Integer, primary_key=True)) + metadata.create_all() + testing.db.connect().execution_options(autocommit=True).\ + execute('alter table t rename id to t_id') + m2 = MetaData(testing.db) + t2 = Table('t', m2, autoload=True) + eq_([c.name for c in t2.primary_key], ['t_id']) + @testing.provide_metadata def test_schema_reflection(self): """note: this test requires that the 'test_schema' schema be