diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2021-04-29 12:59:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-04-29 12:59:42 +0000 |
commit | 93c8f1df8bb68820624559506f6713a16a9e2250 (patch) | |
tree | 52904a5a32eb3d5e8748927d83f34d761d89cda3 /lib/sqlalchemy/sql/compiler.py | |
parent | 11e0466ca2934d630236c45f90db08ad2423c8c6 (diff) | |
parent | d3c73ad8012e15bf47529b3fcb0bac1298fbdb90 (diff) | |
download | sqlalchemy-93c8f1df8bb68820624559506f6713a16a9e2250.tar.gz |
Merge "Propertly ignore ``Identity`` in MySQL and MariaDb."
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 dfdf5832f..f3ae8c44f 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 |