diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-11-12 10:36:03 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-11-12 10:36:03 -0500 |
commit | bbe3f0a27c5b4cb6506d2f23d8a2654c80d6b481 (patch) | |
tree | 14f58d95711635c59fd581746ffbba6a1d682e8d /test/dialect/test_sqlite.py | |
parent | 5b96e3fff73c455ef2ba262dc904bc9b6d28f554 (diff) | |
download | sqlalchemy-bbe3f0a27c5b4cb6506d2f23d8a2654c80d6b481.tar.gz |
- The REFERENCES clause in a CREATE TABLE that includes
a remote schema name now renders the remote name without
the schema clause, as required by SQLite. [ticket:1851]
Diffstat (limited to 'test/dialect/test_sqlite.py')
-rw-r--r-- | test/dialect/test_sqlite.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py index 0cdd3848e..9099ec5d7 100644 --- a/test/dialect/test_sqlite.py +++ b/test/dialect/test_sqlite.py @@ -384,6 +384,27 @@ class SQLTest(TestBase, AssertsCompiledSQL): "SELECT CAST(STRFTIME('%s', t.col1) AS " "INTEGER) AS anon_1 FROM t" % subst) + def test_constraints_with_schemas(self): + metadata = MetaData() + t1 = Table('t1', metadata, + Column('id', Integer, primary_key=True), + schema='master') + t2 = Table('t2', metadata, + Column('id', Integer, primary_key=True), + Column('t2_id', Integer, ForeignKey('master.t1.id')), + schema='master' + ) + + self.assert_compile( + schema.CreateTable(t2), + "CREATE TABLE master.t2 (" + "id INTEGER NOT NULL, " + "t2_id INTEGER, " + "PRIMARY KEY (id), " + "FOREIGN KEY(t2_id) REFERENCES t1 (id)" + ")" + ) + class InsertTest(TestBase, AssertsExecutionResults): |