擅长:python、mysql、java
<p>您要找的Alembic op是<a href="http://alembic.zzzcomputing.com/en/latest/ops.html#alembic.operations.Operations.create_foreign_key" rel="nofollow noreferrer">^{<cd1>}</a>。</p>
<pre><code>op.create_foreign_key(
'fk_location_message_campaign',
'location_messages', 'campaigns',
['campaign_id'], ['id'],
)
</code></pre>
<p>建议您使用<a href="https://docs.sqlalchemy.org/en/latest/core/constraints.html#constraint-naming-conventions" rel="nofollow noreferrer">automatic constraint naming</a>,以便可以将<code>None</code>作为名称传递,而不是手动命名。</p>