summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/naming.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-03-12 14:46:55 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-03-12 14:46:55 -0400
commitd85d6f9a3f1d3132abcd917d4378b2c4e14aec65 (patch)
tree3754298a77e373c677f8447e9329c5a3f38057cb /lib/sqlalchemy/sql/naming.py
parent66338e33bfeab571340b86e321b4237b20456a0f (diff)
downloadsqlalchemy-d85d6f9a3f1d3132abcd917d4378b2c4e14aec65.tar.gz
- Fixed bug in new :paramref:`.MetaData.naming_convention` feature
where the name of a check constraint making use of the `"%(constraint_name)s"` token would get doubled up for the constraint generated by a boolean or enum type, and overall duplicate events would cause the `"%(constraint_name)s"` token to keep compounding itself. fixes #2991
Diffstat (limited to 'lib/sqlalchemy/sql/naming.py')
-rw-r--r--lib/sqlalchemy/sql/naming.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/naming.py b/lib/sqlalchemy/sql/naming.py
index ee99ccbce..bbb843121 100644
--- a/lib/sqlalchemy/sql/naming.py
+++ b/lib/sqlalchemy/sql/naming.py
@@ -22,7 +22,7 @@ class ConventionDict(object):
self._is_fk = isinstance(const, ForeignKeyConstraint)
self.table = table
self.convention = convention
- self._const_name = const.name
+ self._const_name = const._orig_name = getattr(const, '_orig_name', const.name)
def _key_table_name(self):
return self.table.name