Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve default on column duplication when changing column type #234

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

andrew-farries
Copy link
Collaborator

When duplicating a column for backfilling to change a column's type, ensure that any default on the column is preserved on the duplicated column.

This fixes the issue where changing type would lose any DEFAULT defined on the column

This is part of a larger class of issues where duplicated columns are not faithfully preserving all properties of the original, tracked in #227.

@andrew-farries andrew-farries changed the title Preserve default on column duplication Preserve default on column duplication when changing column type Jan 15, 2024
@andrew-farries andrew-farries force-pushed the preserve-default-on-column-duplication branch from b6cf79d to 21d7e9c Compare January 15, 2024 15:55
@andrew-farries andrew-farries force-pushed the preserve-fks-on-change-type branch 2 times, most recently from 763db08 to 7f919a0 Compare January 15, 2024 15:59
@andrew-farries andrew-farries force-pushed the preserve-default-on-column-duplication branch from 21d7e9c to 64a3c91 Compare January 15, 2024 15:59
Base automatically changed from preserve-fks-on-change-type to main January 15, 2024 16:01
Check that changing a column's type preserves a default value defined on
the column.
@andrew-farries andrew-farries force-pushed the preserve-default-on-column-duplication branch from 64a3c91 to 2838f67 Compare January 15, 2024 16:02
@andrew-farries andrew-farries merged commit d803689 into main Jan 16, 2024
24 checks passed
@andrew-farries andrew-farries deleted the preserve-default-on-column-duplication branch January 16, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants