<p dir="auto"><strong>Migrated issue, originally created by Michael Bayer (<a href="https://github.com/zzzeek">@zzzeek</a>)</strong></p>
<p dir="auto">this issue is mostly fixed by <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/sqlalchemy/sqlalchemy/commit/c33d0378802abbc729de55ba205a4309e5d68f6b/hovercard" href="https://github.com/sqlalchemy/sqlalchemy/commit/c33d0378802abbc729de55ba205a4309e5d68f6b"><tt>c33d037</tt></a> with <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384630257" data-permission-text="Title is private" data-url="https://github.com/sqlalchemy/sqlalchemy/issues/3028" data-hovercard-type="issue" data-hovercard-url="/sqlalchemy/sqlalchemy/issues/3028/hovercard" href="https://github.com/sqlalchemy/sqlalchemy/issues/3028">#3028</a> but that is a different issue being fixed here.  if conv() is present we shouldn't be hitting naming convention logic at all.  the below fails in 0.9.4 but succeeds in rel_0_9:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sqlalchemy import UniqueConstraint, Table, MetaData
from sqlalchemy.sql.naming import conv

m = MetaData(naming_convention={&quot;uq&quot;: &quot;uq_%(table_name)s_%(column_0_name)s&quot;})

t = Table('mytable', m)
uq = UniqueConstraint(name=conv('my_special_key'))

t.append_constraint(uq)"><pre class="notranslate"><code class="notranslate">from sqlalchemy import UniqueConstraint, Table, MetaData
from sqlalchemy.sql.naming import conv

m = MetaData(naming_convention={"uq": "uq_%(table_name)s_%(column_0_name)s"})

t = Table('mytable', m)
uq = UniqueConstraint(name=conv('my_special_key'))

t.append_constraint(uq)
</code></pre></div>
<p dir="auto"><strong>Migrated issue, originally created by Maik Riechert (<a href="https://github.com/letmaik">@letmaik</a>)</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mybool = Column(Boolean, nullable=False, default=False)"><pre class="notranslate"><code class="notranslate">mybool = Column(Boolean, nullable=False, default=False)
</code></pre></div>
<p dir="auto">I use PostgreSQL which has a native boolean type. If I then also use naming convention:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;ck&quot;: &quot;ck_%(table_name)s_%(constraint_name)s&quot;,"><pre class="notranslate"><code class="notranslate">"ck": "ck_%(table_name)s_%(constraint_name)s",
</code></pre></div>
<p dir="auto">Then sqlalchemy complains:</p>
<p dir="auto">sqlalchemy.exc.InvalidRequestError: Naming convention including %(constraint_name)s token requires that constraint is explicitly named.</p>
<p dir="auto">If I define the column as</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="isPublic = Column(Boolean(create_constraint=False), nullable=False, default=False)"><pre class="notranslate"><code class="notranslate">isPublic = Column(Boolean(create_constraint=False), nullable=False, default=False)
</code></pre></div>
<p dir="auto">it works, so I think this is a bug in which sqlalchemy doesn't connect the fact that there is a native Boolean and no constraint exists actually.</p>
<hr>
<p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/3067/3067.1.patch">3067.1.patch</a> | <a href="../wiki/imported_issue_attachments/3067/3067.patch">3067.patch</a> | <a href="../wiki/imported_issue_attachments/3067/3067.2.patch">3067.2.patch</a></p>