diff options
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 6168248ff..bd93f5199 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -4257,10 +4257,15 @@ class DDLCompiler(Compiled): if column.computed is not None: colspec += " " + self.process(column.computed) - if column.identity is not None: + if ( + column.identity is not None + and self.dialect.supports_identity_columns + ): colspec += " " + self.process(column.identity) - if not column.nullable and not column.identity: + if not column.nullable and ( + not column.identity or not self.dialect.supports_identity_columns + ): colspec += " NOT NULL" return colspec |