Skip to content

Multi-operation migration support for alter_column rename operations #593

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

Merged
merged 5 commits into from
Jan 14, 2025

Conversation

andrew-farries
Copy link
Collaborator

Ensure that alter_column rename column operations can be used as part of multi-operation migrations:

Add testcases for:

  • add column, rename column
  • rename table, rename column on the renamed table
  • rename column, drop rename column

Update the Rollback and Validate methods to be aware of the effect of previous operations in the same migration and make sure their own changes are visible to other operations in the same migration.

Part of #239

@andrew-farries andrew-farries force-pushed the op-drop-column-multi-op-tests branch from 9408cd8 to 4015541 Compare January 14, 2025 15:43
@andrew-farries andrew-farries force-pushed the op-alter-column-multi-op-tests branch from 3158358 to a0bbb56 Compare January 14, 2025 15:43
@andrew-farries andrew-farries force-pushed the op-drop-column-multi-op-tests branch from 4015541 to e726c8e Compare January 14, 2025 15:48
@andrew-farries andrew-farries force-pushed the op-alter-column-multi-op-tests branch from a0bbb56 to d8f886a Compare January 14, 2025 15:48
Base automatically changed from op-drop-column-multi-op-tests to main January 14, 2025 15:52
Rename the column back to its original name in the virtual schema on
`OpAlterColumn.Rollback` if required. This ensures that `Rollback`
operations that precede this operation can find the column in the schema
under the name that they expect.
Ensure that a column can be renamed in a table that has been renamed by
a previous operation in the same migration.
If the column is being renamed, make that change in the virtual schema
so that subsequent operations can validate using the new column name.
@andrew-farries andrew-farries force-pushed the op-alter-column-multi-op-tests branch from d8f886a to 345ed26 Compare January 14, 2025 15:52
@andrew-farries andrew-farries merged commit e689a12 into main Jan 14, 2025
28 checks passed
@andrew-farries andrew-farries deleted the op-alter-column-multi-op-tests branch January 14, 2025 16:00
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.

2 participants