diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-09-26 22:31:05 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-09-26 22:31:05 -0400 |
commit | 4df1f8393d4f44e74f82d35cf7237b28632a7745 (patch) | |
tree | 86c42e37c163dadce399ea4f769a8427b6fe473c /lib/sqlalchemy/sql | |
parent | 8c07c68c36815de6cb3aeeeb87a94824310cb551 (diff) | |
download | sqlalchemy-4df1f8393d4f44e74f82d35cf7237b28632a7745.tar.gz |
add "index", "unique" to Column.merge() attrs
Fixes: #8578
Change-Id: Ic79c19748d5bb00353d0a97f3a4b4f5eb9fdbb0c
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r-- | lib/sqlalchemy/sql/schema.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 565537109..bbf78e6a1 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -2327,6 +2327,12 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]): new_onupdate = self.onupdate._copy() new_onupdate._set_parent(other) + if self.index and not other.index: + other.index = True + + if self.unique and not other.unique: + other.unique = True + for const in self.constraints: if not const._type_bound: new_const = const._copy() |