summaryrefslogtreecommitdiff
path: root/test/dialect/test_postgresql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-10-04 12:30:23 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-10-04 12:30:23 -0400
commit771f6fba4c76d4c65c4326cbbc5ce1d909d7358a (patch)
treeff884b08ba8a34713fe40592aefeb1d95b590e16 /test/dialect/test_postgresql.py
parent539c7a1ca26d4338f2cec326dad7a17a2f0ac267 (diff)
downloadsqlalchemy-771f6fba4c76d4c65c4326cbbc5ce1d909d7358a.tar.gz
add a test to confirm alter table of pk column gets reflected
Diffstat (limited to 'test/dialect/test_postgresql.py')
-rw-r--r--test/dialect/test_postgresql.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py
index 8f90becd5..b37344b27 100644
--- a/test/dialect/test_postgresql.py
+++ b/test/dialect/test_postgresql.py
@@ -1317,6 +1317,17 @@ class ReflectionTest(fixtures.TestBase):
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
separate and accessible by the test user"""