def create_foreign_key(
self, name, referent, local_cols, remote_cols, **kw):
"""Issue a "create foreign key" instruction using the
current batch migration context.
The batch form of this call omits the ``source`` and ``source_schema``
arguments from the call.
e.g.::
with batch_alter_table("address") as batch_op:
batch_op.create_foreign_key(
"fk_user_address",
"user", ["user_id"], ["id"])
.. seealso::
:meth:`.Operations.create_foreign_key`
"""
return super(BatchOperations, self).create_foreign_key(
name, self.impl.table_name, referent, local_cols, remote_cols,
source_schema=self.impl.schema, **kw)
评论列表
文章目录