Produce a copy of this :class:`_schema.ForeignKey` object. The new :class:`_schema.ForeignKey` will not be bound to any :class:`_schema.Column`. This method is usually used by the internal copy procedures of :class:`_schema.Column`, :class:`_schema.Table`, a
(self, *, schema: Optional[str] = None, **kw: Any)
| 3250 | return self._copy(schema=schema, **kw) |
| 3251 | |
| 3252 | def _copy(self, *, schema: Optional[str] = None, **kw: Any) -> ForeignKey: |
| 3253 | """Produce a copy of this :class:`_schema.ForeignKey` object. |
| 3254 | |
| 3255 | The new :class:`_schema.ForeignKey` will not be bound |
| 3256 | to any :class:`_schema.Column`. |
| 3257 | |
| 3258 | This method is usually used by the internal |
| 3259 | copy procedures of :class:`_schema.Column`, :class:`_schema.Table`, |
| 3260 | and :class:`_schema.MetaData`. |
| 3261 | |
| 3262 | :param schema: The returned :class:`_schema.ForeignKey` will |
| 3263 | reference the original table and column name, qualified |
| 3264 | by the given string schema name. |
| 3265 | |
| 3266 | """ |
| 3267 | fk = ForeignKey( |
| 3268 | self._get_colspec(schema=schema), |
| 3269 | use_alter=self.use_alter, |
| 3270 | name=self.name, |
| 3271 | onupdate=self.onupdate, |
| 3272 | ondelete=self.ondelete, |
| 3273 | deferrable=self.deferrable, |
| 3274 | initially=self.initially, |
| 3275 | link_to_name=self.link_to_name, |
| 3276 | match=self.match, |
| 3277 | comment=self.comment, |
| 3278 | **self._unvalidated_dialect_kw, |
| 3279 | ) |
| 3280 | return self._schema_item_copy(fk) |
| 3281 | |
| 3282 | def _get_colspec( |
| 3283 | self, |