summaryrefslogtreecommitdiff
path: root/test/sql/test_compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/sql/test_compiler.py')
-rw-r--r--test/sql/test_compiler.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index 8b4e5053b..27cab65ac 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -3066,7 +3066,7 @@ class DDLTest(fixtures.TestBase, AssertsCompiledSQL):
"CREATE TABLE t (x INTEGER, z INTEGER)"
)
- def test_composite_pk_constraint_autoinc_first(self):
+ def test_composite_pk_constraint_autoinc_first_implicit(self):
m = MetaData()
t = Table(
't', m,
@@ -3081,6 +3081,22 @@ class DDLTest(fixtures.TestBase, AssertsCompiledSQL):
"PRIMARY KEY (b, a))"
)
+ def test_composite_pk_constraint_maintains_order_explicit(self):
+ m = MetaData()
+ t = Table(
+ 't', m,
+ Column('a', Integer),
+ Column('b', Integer, autoincrement=True),
+ schema.PrimaryKeyConstraint('a', 'b')
+ )
+ self.assert_compile(
+ schema.CreateTable(t),
+ "CREATE TABLE t ("
+ "a INTEGER NOT NULL, "
+ "b INTEGER NOT NULL, "
+ "PRIMARY KEY (a, b))"
+ )
+
def test_create_table_suffix(self):
class MyDialect(default.DefaultDialect):
class MyCompiler(compiler.DDLCompiler):