diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2021-03-07 16:30:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-03-07 16:30:34 +0000 |
commit | 1edbe841bcb43d761f5084a2e77e8f37ee041c35 (patch) | |
tree | 0bf6d20235d6c02197ffac42452177fe376e1570 /lib/sqlalchemy/sql/compiler.py | |
parent | b42f746b027c603a1ac03c30b81badf2bd0a4ab7 (diff) | |
parent | 506b88de5e428fd4ad2feff663ba53e2dbb28891 (diff) | |
download | sqlalchemy-1edbe841bcb43d761f5084a2e77e8f37ee041c35.tar.gz |
Merge "Fix named CHECK constraint name omitted on repeated creates"
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index f635c1ee4..8f046a802 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -4882,16 +4882,13 @@ class IdentifierPreparer(object): def format_constraint(self, constraint, _alembic_quote=True): naming = util.preloaded.sql_naming - if isinstance(constraint.name, elements._defer_name): + if constraint.name is elements._NONE_NAME: name = naming._constraint_name_for_table( constraint, constraint.table ) if name is None: - if isinstance(constraint.name, elements._defer_none_name): - return None - else: - name = constraint.name + return None else: name = constraint.name |