diff options
author | Michael Trier <mtrier@gmail.com> | 2008-12-28 07:40:56 +0000 |
---|---|---|
committer | Michael Trier <mtrier@gmail.com> | 2008-12-28 07:40:56 +0000 |
commit | cae83f6d4fc3eef57814e6bd554bc39461644359 (patch) | |
tree | 6fa7468f27e727b43e6d5eeaf9080363e0639af1 /lib/sqlalchemy/databases/mssql.py | |
parent | defba2fc020556dadd106e7e4e35907216d9208d (diff) | |
download | sqlalchemy-cae83f6d4fc3eef57814e6bd554bc39461644359.tar.gz |
On MSSQL if a field is part of the primary_key then it should not allow NULLS.
Diffstat (limited to 'lib/sqlalchemy/databases/mssql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mssql.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/databases/mssql.py b/lib/sqlalchemy/databases/mssql.py index 777c86d40..61f54a8ba 100644 --- a/lib/sqlalchemy/databases/mssql.py +++ b/lib/sqlalchemy/databases/mssql.py @@ -1499,7 +1499,7 @@ class MSSQLSchemaGenerator(compiler.SchemaGenerator): colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect).get_col_spec() if column.nullable is not None: - if not column.nullable: + if not column.nullable or column.primary_key: colspec += " NOT NULL" else: colspec += " NULL" |