| 4940 | return self._copy(target_table=target_table, **kw) |
| 4941 | |
| 4942 | def _copy( |
| 4943 | self, *, target_table: Optional[Table] = None, **kw: Any |
| 4944 | ) -> CheckConstraint: |
| 4945 | if target_table is not None: |
| 4946 | # note that target_table is None for the copy process of |
| 4947 | # a column-bound CheckConstraint, so this path is not reached |
| 4948 | # in that case. |
| 4949 | sqltext = _copy_expression(self.sqltext, self.table, target_table) |
| 4950 | else: |
| 4951 | sqltext = self.sqltext |
| 4952 | c = CheckConstraint( |
| 4953 | sqltext, |
| 4954 | name=self.name, |
| 4955 | initially=self.initially, |
| 4956 | deferrable=self.deferrable, |
| 4957 | _create_rule=self._create_rule, |
| 4958 | table=target_table, |
| 4959 | comment=self.comment, |
| 4960 | _autoattach=False, |
| 4961 | _type_bound=self._type_bound, |
| 4962 | ) |
| 4963 | return self._schema_item_copy(c) |
| 4964 | |
| 4965 | |
| 4966 | class ForeignKeyConstraint(ColumnCollectionConstraint): |