Copy column defaults in Table.to_metadata
``Table.to_metadata()`` reused the original column's ``default``,
``onupdate``, ``server_default``, and ``server_onupdate`` objects.
Attaching those objects to the copied column changed their ``column``
reference, leaving the original column's defaults associated with the
copy.
This change copies each default generator before constructing the new
column. Sequence defaults are copied into the target metadata
collection so both the original and copied metadata retain their own
sequence objects.
Regression tests verify ownership for client-side defaults, server-side
defaults, on-update values, and sequence defaults. Existing merge-copy
expectations now assert that each copied default remains associated with
its own column.
Fixes: #13481
Closes: #13482
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13482
Pull-request-sha:
3dfbe0d91c99cd33bb059937478b9ecb398d3613
Change-Id: Ifceb7802028ff8560937b265c2f55ed93e657fc5