diff options
author | Saulius Žemaitaitis <saulius@zemaitaitis.lt> | 2016-03-27 13:08:38 +0300 |
---|---|---|
committer | Saulius Žemaitaitis <saulius@zemaitaitis.lt> | 2016-03-27 13:08:38 +0300 |
commit | 5c43c34b82db80a672c524246059875813988843 (patch) | |
tree | 92862b818fab1493295b54dfa9325c1e4f2a38e3 /test/dialect/mssql/test_compiler.py | |
parent | d594691a1af4e0d6b12aa4a5c1f1ede178a8985c (diff) | |
download | sqlalchemy-pr/252.tar.gz |
Allow creating explicit non-clustered primary keys in MS SQL.pr/252
Diffstat (limited to 'test/dialect/mssql/test_compiler.py')
-rw-r--r-- | test/dialect/mssql/test_compiler.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py index b59ca4fd1..2d5e986d3 100644 --- a/test/dialect/mssql/test_compiler.py +++ b/test/dialect/mssql/test_compiler.py @@ -625,6 +625,18 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "PRIMARY KEY CLUSTERED (x, y))" ) + def test_table_pkc_explicit_nonclustered(self): + metadata = MetaData() + tbl = Table('test', metadata, + Column('x', Integer, autoincrement=False), + Column('y', Integer, autoincrement=False), + PrimaryKeyConstraint("x", "y", mssql_clustered=False)) + self.assert_compile( + schema.CreateTable(tbl), + "CREATE TABLE test (x INTEGER NOT NULL, y INTEGER NOT NULL, " + "PRIMARY KEY NONCLUSTERED (x, y))" + ) + def test_table_uc_clustering(self): metadata = MetaData() tbl = Table('test', metadata, |