Skip to content

Conversation

@winor30
Copy link
Contributor

@winor30 winor30 commented Jan 16, 2026

Why

  • When dropping a column, FK matching used only the column name and produced diffs that dropped unrelated FKs.

How

  • Restrict FK drops to constraints on the target table’s columns, or constraints that reference the target table’s columns.
  • Add regression tests to ensure same column name / same referenced column name don’t cause unrelated FK drops.

- Enhance constraint and column handling in DDL operations.
- Improve test coverage for dropping constraints and columns with complex relationships.
- Refactor code for clarity, including updates to function signatures and processing logic.

Signed-off-by: katsumata <12413150+winor30@users.noreply.github.com>
- Refactor database schema by renaming `t1_2` to `col_1` across multiple tables.
- Update foreign key constraints to ensure integrity with the new column name.
- Adjust test cases to verify the correctness of the updated SQL statements.

Signed-off-by: katsumata <12413150+winor30@users.noreply.github.com>
@winor30 winor30 changed the title Improve constraint handling and table modification logic Fix foreign key drops on column removal Jan 16, 2026
@daichirata daichirata merged commit 963bb84 into daichirata:master Jan 24, 2026
6 checks passed
@daichirata
Copy link
Owner

@winor30 Thanks for the fix!

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